Pedal up a steep hill in the same gear you use on the flat and your legs will tell you something is wrong. The pedals feel like they are set in concrete. Click down to an easy gear and the climb becomes bearable, but now your feet spin madly and the bike barely creeps forward. Nothing about you or the hill changed. Only a pair of toothed wheels did.

Try it: gear workshop

Drag the left gear with a finger or the mouse, or press Spin. Then change the tooth counts.

Two wheels, one rule

Gear teeth are spaced the same distance apart on every gear that meshes together. So when one tooth passes, one tooth passes on the other gear too. That is the whole mechanism. A gear with 20 teeth meshed with a gear with 40 teeth hands over 20 teeth for every turn of the small one, and 20 teeth is only half a turn of the big one.

The rule is the number of teeth on the driven gear divided by the number on the driver. In the workshop above, the starting pair gives 40 ÷ 20 = 2. The driven gear turns half as fast and in the opposite direction. Swap the sliders and it turns twice as fast instead.

Speed is only half the story

Look at the two bars in the workshop. When the output speed bar shrinks, the force bar grows by the same factor. This is not a coincidence. It is the deal that every gearbox, lever and pulley offers: you can trade speed for twisting force, and the exchange rate is exactly the gear ratio.

The reason is that power, the rate at which energy flows, equals twisting force (torque) multiplied by turning speed. A gear pair simply passes that energy along. If it comes out turning half as fast, it must be twisting twice as hard, or the numbers would not add up. The readout under the bars shows that speed multiplied by torque stays at 1.00 in the ideal case, whatever teeth you choose.

Gears do not make energy. They change the shape of what you were already giving: a quick, light turn becomes a slow, strong one, or the reverse.

What the bike is doing

A road bike with a typical compact setup has a front gear of 34 or 50 teeth and a set of rear gears running from about 11 teeth to as many as 34. Press the two bike buttons to see the extremes. On the hill, 34 teeth drive 34, so a pedal turn is one turn of the rear sprocket. On the flat, 50 teeth drive 11, so one pedal turn spins the rear sprocket about 4.5 times.

The same push from your legs reaches the rear wheel as a gentle shove in the big gear and as a hard shove in the small one, but the hard shove is slow in coming. Your legs can only produce so much force and so much speed. A steep hill needs lots of force at the wheel, so you pick the ratio that gives it to you and accept that the wheel turns less for each pedal stroke. On the flat the force needed is small, so you take speed instead.

The same trick everywhere

A long wrench on a stuck bolt is the same bargain: a bigger arm means a smaller push, and your hand moves further. A car's gearbox does it in steps, with first gear for pulling away and top gear for cruising. A cordless drill has a switch for slow and strong or fast and light, and the switch changes a gear pair.

Where the tidy story slips

Real gears are not perfect. Friction in the teeth and bearings turns a little of the power into heat, so a little less comes out than went in. For a well-made, well-oiled pair the loss is small, but a long chain of gears loses a bit at every mesh. Teeth also need a tiny gap so they do not jam, which is why you can feel a slight wobble when you change direction. None of this changes the main rule: trade speed for force, at the rate the teeth set.

So next time you shift down at the foot of a hill, you are not making the climb easier. You are making it slower in exactly the proportion that makes your legs able to cope.