Calibrate your measurements by first accurately measuring the diameter of your rear wheel. To do so, first place light-colored tape down in a straight line on the ground. The line should be at least 110 inches long.
Shift your bike into highest gear for maximum measurement accuracy.
Line up the bike straight with the line of tape, with the tape all behind the bike. Place the bottom of the rear tire so it is on top of the exact end of the line of tape.
Freewheel the pedals backward (backpedal) to get the cranks to line up with the seatpost. This will make it easier to tell when you've completed a full revolution of the cranks.
Lift the front wheel a little off the ground and walk the back wheel back over the tape, keeping the rear wheel as straight as you can. The cranks will pedal backward on their own while you do this.
Stop walking precisely when the cranks complete one full revolution.
Mark the tape where the rear wheel stopped. Measure this distance, denoting it with the letter D. Count the teeth of the chainring and cog that you used, denoting them with the letters F for "front" and B for "back". (The chainring is in front, attached to the cranks. The cog is in back, on the freewheel of the rear hub.) D is the gear inches of your highest gear.
Multiply D by B/F to back the gear ratio out of the highest gear's gear inches measurement. Denote the result with the letter C. This is the conversion constant to use from now on with this particular rear wheel to convert from chainring and cog tooth count to gear inches.
As an example, suppose the gears 52x13 (52-tooth chainring, 13-tooth cog) have 108 gear inches for your wheel. Backing out the gear ratio gives C = Dx(B/F) = 108x(13/52) = 27 inches as the diameter of your tire. Multiply C by any gear combination FxB to get its gear-inches. For example, a 42x25 combination has 27x(42/25) = 45.4 gear-inches.
Check your work with an online gear ratio calculator or table (see Resources).