The correct chain length
The correct chain length takes care of the optimum chain tension at the rear derailleur. If the chain is too long, then it will no longer be properly tensioned when running on the smallest of rear sprockets, it will also start to flap uncontrolled about whenever the bicycle is ridden over the smallest of bumps. If the chain is too short, then the ratio of riding on the largest chain ring and the largest rear sprocket will no longer be possible. Should the shifter accidentally be pushed into this position, then it is highly possible that the rear derailleur and the derailleur hanger itself could get severely bent and damaged.
There are two ways to correctly determine the length of the chain:
For the general practitioner:
This is the way that the majority of chains are measured. To start, take the chain by the end with the pertruding pin, add the number of teeth on the largest sprocket and the largest chain ring together, divide this number by two and finally add two to this number.
For example: Largest chainring has 44 teeth, largest sprocket has 28 teeth
44 + 28 = 72 : 2 = 36
36 + 2 = 38
Now measure the length of the chainstay. The start end of the chain should be held at the centre of the quick release skewer and taken to the centre of the bottom bracket. This distance should be measured twice (if the ends of this measured distance are not able to be joined together, then add another link to this). Next, take this length of chain and add the number of links (that we calculated before) to it. This is the position where the chain should be shortened. The chain is now the correct length and has two different ends to allow it to be joined together, take care to follow the manufactures instructions when rejoining the chain together.

For the mathematition:
The following formula can be used to calculate the precise length of the bicycle chain:
LK = 0,157a + 1/2 Z1 + 1/2 Z2 + 2
LK = chain length in links (number of pins)
a = chainstay length in mm (quick release skewer to bottom bracket center)
Z1 = number of teeth on the largest chainring
Z2 = number of teeth on the largest sprocket
Example:
Chainstay length a=420mm, Z1=44 teeth, Z2=28 teeth
LK=0,157 x 420 + 44/2 + 28/2 + 2
LK = 103,94 which means 104 links
IMPORTANT:
The result is always rounded up or down to the next even number. This is due to the fact that one end of the chain has to have the opposite type of link to the that of the first link in order to allow the chain to be rejoined.



