Formulas: (pick one)

 driven=(drive*diff)/(speedo/(inches/(PI*diam))) driven=(drive*diff)/(speedo/(inches/c)) driven=(drive*diff)/(speedo/revs)

 driven teeth on speedo driven gear (changeable, this is the new part you need to order) drive teeth on t-case speedo drive gear (fixed, 13 on D20/D300/NV200, try 4 for D18) diff rear diff ratio (like 3.31, 3.73, 4.10, 4.56, 4.88, etc...) speedo revs speedo wants per mile (normally 1000 on late CJ) inches constant value, inches=63360 (inches in a mile) diam tire's actual diameter, in inches (twice rolling radius) PI constant value, PI=3.14159... c tire's actual circumference rolling on the ground, in inches revs tire's actual revs per mile

Notes/Tips:
To be exact, use the true tire size not what it says on the tire. (a 32x11.50R15 tire can be 30" to 32" in diameter)
Mark a starting point on your tire and on a flat level road. Run exactly 3 revs of your tire (about 20 to 30 feet) measure the distance from start to finish. Then divide by 3 for your average inches per full rev., which is the rolling circumference of your tire.
You should have a normal load of people an equipment. Normally 500 to 700 lbs. and set your tire to the normal highway pressure. Note that pressure will affect the size (circumference) of the tire.
As your tires ware down your rolling circumference will decrease a bit. About up to 3% depending on tire size and tread depth. (decreasing diameter and circumference, increasing revs per mile...increasing the number of teeth on your required gear)

Other good speedo sites: