Trainer ID number

A Pokémon Trainer's ID number (Japanese: IDNo.) is a randomly generated number that is assigned to a player when they create a new save file or register a new account. Any Pokémon that this Trainer obtains have the number shown in their summary; it is used, in conjunction with the Trainer's name and gender, to identify whether the Pokémon is an outsider Pokémon. The ID numbers of a player's Pokémon are also used in the Loto-ID to determine whether they will win a prize, and if so which prize they will win. Starting in Generation III, whether a Pokémon is is determined by a formula that takes into consideration their ID number and personality value.
The smallest possible Trainer ID number is 0. Prior to Generation VII, the largest was ; starting in Generation VII, it is instead 999999. Prior to Generation IX, ID numbers had s, so if the Trainer ID was less than 5 (Generations to ) or 6 (Generations and ) digits long, leading zeros would be added to the beginning to make it that length. For example, a Trainer ID that appears as "00123" or "000123" in prior generations would both appear as simply "123" in Generation IX.
s display ????? (prior to Generation VII) or ?????? (from Generation VII onwards) as their ID number until they are hatched, at which point the ID becomes the hatcher's ID number. Shadow Pokémon also display ????? as their ID number until they are purified, at which point the number is revealed to be the ID of the Trainer who snagged the Pokémon.
==Secret ID==
From Generation III onward, in addition to their regular ID numbers, Trainers and Pokémon are also assigned a second, unseen ID number different from the visible one. This number exists to reduce the chances of the games erroneously identifying a Pokémon from another Trainer as not being an outsider Pokémon, since even if two Trainers share the exact same name, gender, and Trainer ID number, the games will still recognize their Pokémon as coming from different Trainers should their secret ID numbers be different. A Pokémon's Secret ID number is also used along with its main ID number and personality value in determining if it is . Although a Secret ID number cannot be viewed without cheating devices or executing a series of glitches, it is possible to calculate it via third party tools, as the generation of the Trainer and Secret IDs are not truly random.
Secret IDs of Pokémon obtained prior to Generation VII are five digits long; those of Pokémon obtained in Generation VII onwards are four digits long. Pokémon transferred to Pokémon Bank from the Virtual Console releases of Generations and are given a Secret ID of 00000.
If two different Trainers have the same Trainer name and gender, as well as identical Trainer ID numbers and Secret ID numbers (a 1 in 4,294,967,296 chance), the games will typically recognize the two Trainers as the same and will not consider their Pokémon to be outsider Pokémon, which can cause minor bugs related to met location. For example, Pokémon Colosseum and use location index numbers that conflict with each other, so if one player has a Pokémon traded from the other GameCube game with the same trainer and secret ID, it will likely display the wrong met location rather than the fallback "distant land" normally used for outsider Pokémon. Conversely, (not Emerald) and use location index numbers that are incompatible but do not overlap, so if one player has a Pokémon from the other game that is not an outsider, it will display the otherwise-unreadable text "Met somewhere.", rather than the correct text, "Met in a trade."
==Alterations in Generation VII==
From Generation VII onward, the Trainer ID is a six-digit number instead of a five-digit number. Instead of generating two 16-bit numbers (between 0 and 65535), one for Trainer ID and one for Secret ID, the game instead generates one 32-bit number (between 0 and 4,294,967,295), then takes the last six digits as the Trainer ID. The first four digits then essentially become the Secret ID, ranging from 0000 to 4294. 
If a Pokémon originating from a Generation VI or earlier game is transferred to a Generation VII or later game, its Trainer ID and Secret ID will both remain 5 digits long.
==Special ID numbers==
In most cases, Pokémon received from in-game trades, events, or other such special conditions have a predetermined ID number.
==Loto-ID==
Once per week in Generation II and once per day in Generations , , , , and , the player may take part in the Loto-ID. This involves the generation of a random five-digit number, which is compared with the player's Pokémon's ID numbers. Depending on the game and the nature of the matching digits, the player can receive a prize. This feature is not included in the Generation I, Generation V, or Generation IX games, and is also absent from Pokémon Legends: Arceus.
==Differing events==
Some events in the games differ depending on the player's ID number. These usually utilize the last digit or the number as the number of variations of the event. As the ID number can't be modified after the creation of a savefile, these events are set as soon as a new file is created. These events include:
===Generation II===
* The encounter rate of each headbutt tree. 
===Generation III===
* Which one of the old guys will appear in Mauville City.
* Which Berry the will give daily on Route 120.
* Which lady will appear in the Lilycove City Pokémon Center.
* Which Trainer class will represent the player in a Secret Base when they mix records.
Mixing records allows players to exchange events. An online calculator to determine the events based on Trainer ID in Generation III can be found here.
===Generation IV===
* Where two of the four Honey Trees that have a chance of containing are located.
* Which of two Fossils (Armor or Skull) will appear in the Underground.
===Generation V===
* Which shop the first visitor on Join Avenue will open.
===Generation VI===
* Which Berry the will give daily on Route 120.
===Others===
Additionally, some features such as the coloration of nicknamed Pokémon in Pokémon Stadium 2, the password for resetting time in , Walda's wallpapers in , and Primo's gifts are calculated using the player's ID number for their outputs. A password generator, such as the one found in filb.de, is required to determine the inputs to trigger some of these events, while others, such as the rate at which specific forms spawn in or the two remaining Munchlax Honey Trees, use the Secret ID number for their calculations.
==In other languages==
==External links==
* Trainer ID Event Calculator at pokecheats.net (Archive)
Category:Game mechanics
Category:Terminology
de:ID-Nummer
es:ID de entrenador
fr:ID
it:Numero ID Allenatore
ja:ID
zh:ID No.