Pokémon Ruby Version, Sapphire Version, and Emerald Version - Size Calculation
The size of a Magikarp, Heracross, Barboach, and so on is calculated in two steps.
First, the game calculates the value of S with the formula below.
S = (((AT xor DF)*HP) xor M) * 256 + (((SA xor SD)*SP) xor N)
where:
- HP is the remainder of the HP individual value (IV) divided by 16.
- AT is the remainder of the Attack IV divided by 16.
- DF is the remainder of the Defense IV divided by 16.
- SP is the remainder of the Speed IV divided by 16.
- SA is the remainder of the Special Attack IV divided by 16.
- SD is the remainder of the Special Defense IV divided by 16.
- M is the remainder of the personality ID divided by 256 (the lowest byte of the ID).
- N is the remainder of (personality ID / 256) divided by 256 (the second lowest byte of the ID).
- Each division above is rounded down.
-
"xor" represents an "exclusive or" operation:
- Let A and B be the two numbers on either side of the "xor", let C be 1, and let R be 0.
- If A is odd and B is even, or vice versa, add C to R.
- Multiply C by 2, and divide A and B each by 2, rounding down.
- Repeat steps 2 and 3 until A and B are both 0.
- The result of the "exclusive or" operation is R.
Then the game calculates the size of the Pokémon, in millimeters, using this formula:
Size = int(int((S-Z)/Y+X)*C/10)
where:
- C is the height of the Pokémon in tenths of a meter, as shown on the Pokédex.
-
X, Y, and Z are based on the value of S as follows:
- If S is from 0 through 9, then X=290, Y=1, Z=0.
- If S is from 10 through 109, then X=300, Y=1, Z=10.
- If S is from 110 through 309, then X=400, Y=2, Z=110.
- If S is from 310 through 709, then X=500, Y=4, Z=310.
- If S is from 710 through 2709, then X=600, Y=20, Z=710.
- If S is from 2710 through 7709, then X=700, Y=50, Z=2710.
- If S is from 7710 through 17709, then X=800, Y=100, Z=7710.
- If S is from 17710 through 32709, then X=900, Y=150, Z=17710.
- If S is from 32710 through 47709, then X=1000, Y=150, Z=32710.
- If S is from 47710 through 57709, then X=1100, Y=100, Z=47710.
- If S is from 57710 through 62709, then X=1200, Y=50, Z=57710.
- If S is from 62710 through 64709, then X=1300, Y=20, Z=62710.
- If S is from 64710 through 65209, then X=1400, Y=5, Z=64710.
- If S is from 65210 through 65409, then X=1500, Y=2, Z=65210.
- If S is from 65410 through 65535, then X=1700, Y=1, Z=65510.
Because of this formula, a Pokémon’s actual size can range from 29% to 172.6% of its Pokédex height. The distribution is similar to a normal distribution, with a mean of about 100% and a standard deviation of about 17.9%. When converting to inches (1 inch = 25.4 mm), the game turns down to the nearest tenth of an inch.