Chain length calculator
Two calculators: a derailleur bike, sized by Park Tool's largest-ring, largest-cog method, and a fixed two-sprocket drive such as a single-speed, motorcycle or machine.
Bicycle with a derailleur
Single-speed, motorcycle or machine chain
ANSI chain numbers give the pitch in eighths of an inch in the digits before the last (#40 = 4/8 in). Motorcycle chain sizes such as 520 or 428 are numbered differently: take the pitch from your chain's specification.
How it's worked out
The chain's path is the pitch circle of each sprocket (radius = pitch ÷ (2 sin(180° ÷ teeth))) joined by two straight runs, the same geometry as a belt. That length in pitches is rounded up to a whole, even number of links so inner and outer links alternate. A real chain sits on a polygon rather than a circle, so treat the answer as within a link.
For derailleur bikes, Park Tool's guide wraps the chain round the largest ring and largest cog without going through the derailleur, finds where the ends can be joined, then adds two rivets (one inch) for cogs up to 36 teeth, or four rivets for 42 teeth and up. This page estimates that from the geometry; the guide itself is done on the bike, which is the check to trust. Source: Park Tool, Chain Length Sizing.
Tested: equal sprockets wrap exactly 2C/p + N links, bicycle chains follow Park Tool’s big-big plus 2 or 4 rule, and fixed-drive chains round up to an even number of links (packages/mechanics/test/maker.test.ts).
Related: Bike gear calculator · Sprocket ratio calculator · Belt length calculator