Mechanisms · MightyCog guide

How does a cog railway climb a mountain? The story of the rack railway, rebuilt

Why ordinary trains stall on steep hills, how a toothed rail let Mount Washington and Pilatus trains climb, and a Technic-style rack loco you can test.

For train fans, history lovers and educators · 30 October 2026 · 4 min read

Try Cog Railway Climber for free →

Get the matching PDF pack · $5.99

A cog railway climbs slopes that would leave an ordinary train spinning its wheels by adding a toothed rail between the running rails and a gear under the train that bites into it. Ordinary trains push on the rails through friction alone, and that grip runs out at around a 10% grade. A toothed gear doesn’t need grip: it pushes on teeth, so rack railways climb grades of 25%, 37% and even 48%.

The idea began with one tired climber in New Hampshire, and you can test it on a table with our Cog Railway Climber (level 4, about 55 minutes).

1861: a hard climb and a patent

Sylvester Marsh was a civil and mechanical engineer who found climbing Mount Washington hard going and decided there should be a railway to the top. According to the ASME’s landmark history, he patented his cog mechanism in 1861.

Marsh’s answer was a ladder-like rack laid between the rails and bolted to the ties, with toothed wheels on the locomotive engaging it. The first trip ran in 1866, the line held its opening celebration on 14 August 1868, and the first train reached the summit on 3 July 1869. The ASME calls it “the first mountain climbing railway in the world”.

Why couldn’t an ordinary train do it?

A train wheel pushes forwards only as hard as friction lets it grip the rail. Smooth steel on smooth steel isn’t very grippy, and on a slope part of the train’s weight pulls it back down. Railways that rely on friction alone top out around a 10% grade: 10 m up for every 100 m along, an angle of only about 5.7°.

That is the first trap in this topic. A grade is a percentage (rise ÷ run), not an angle. The steepest part of Marsh’s line, a trestle called Jacob’s Ladder, is a 37.4% grade, which is about 20.5°. The whole line averages about 25% as it climbs almost 3,600 feet.

Europe follows: Rigi, Abt and Pilatus

Swiss engineers took the idea further. Niklaus Riggenbach built a ladder rack of his own, and the Vitznau–Rigi railway opened on 22 May 1871, the first mountain rack railway in continental Europe. In 1882 Carl Roman Abt designed a cheaper rack of solid bars with vertical teeth, designed so the pinions are always engaged, but it was limited to about 25%.

The record belongs to the Pilatus Railway, opened in 1889: up to 48%. It uses Eduard Locher’s system, with the teeth sticking out sideways from a flat bar and horizontal pinions on the locomotive gripping it. Rack trains are slow, running at about 9 to 25 km/h, but they climb where nothing else on rails can.

How the model copies a real rack railway

The Cog Railway Climber runs on two 5×11 frames laid end to end, with five 1×4 racks down the middle as the toothed rail. Its four small wheels aren’t driven at all: they only carry the weight, just like the running wheels on a pure rack line. An L motor stands on its nose and turns a worm, the worm turns a 24-tooth gear, and a 16-tooth pinion on the same shaft walks along the racks.

The worm does two jobs. It slows the drive right down: one motor turn moves the 24-tooth gear on by just one tooth, so the loco creeps about 2 mm per motor turn and the motor has plenty of force to spare. And a 24-tooth gear can’t turn a worm backwards, so when you stop, the train stays put. Real rack locomotives rely on powerful brakes for that; our worm gear post explains why a worm locks.

Try it: grade, angle and climb

Choose a real railway’s grade, predict the angle and the height to prop the track, then check:

Interactive: Cog railway lab. Tilt the Cog Railway Climber’s track to real railway grades, from the 10% limit for wheel grip to the Pilatus Railway’s 48%: convert grade to degrees, work out the book height and see how far the worm-driven pinion climbs per motor turn. Five predict-then-check challenges.

The pinion rolls about 50 mm along the rack for each of its own turns, the same rule our rack travel post measures on a bench.

Test it on a table

The build’s play idea is a fair test: lift one end of the track on books and drive up. Measure the height of the far end, work out the grade with the lab, and record what happens:

GradeEnd heightClimbs?Holds?
10%
25%
37.4%
48%

Keep going past 48%: the build’s own play notes ask how steep it can climb before the wheels lift off. That is the limit of the model, not of the rack idea. For contrast, try the Motor Buggy, which drives through its wheels, up a board at the same slope, and read our torque post on why the slow, strong gearing matters. The rack and pinion idea page has the basics.

Interactive: Check yourself. A few quick questions on the ideas in this guide, each with an explanation.

  1. Why can’t an ordinary train climb a very steep hill?
  2. A 37.4% grade, like Jacob’s Ladder on Mount Washington, is about how many degrees?
  3. On the Cog Railway Climber, what pushes the loco uphill?
  4. Why does the model stay put when you stop it halfway up?

Put the ideas into motion

  • 🚞 Cog Railway Climber: A mountain train that grips a toothed rail — it climbs super steep ramps and never slides back. (level 4 of 5, about 55 minutes, 20 steps)
  • Worm-Gear Crane🏗️ Worm-Gear Crane: Crank the worm gear to lift the boom — then let go. It stays up by itself! (level 3 of 5, about 30 minutes, 15 steps)
  • 🔋 Motor Buggy: Your first car that drives by itself — with a forwards/backwards switch and headlights! (level 3 of 5, about 30 minutes, 20 steps)

Explore the engineering

Mechanical Wonders booklet pack cover

Mechanical Wonders booklet pack

Keep all 36 booklets together. Print a binder or build offline, without opening each guide separately.

$5.99 · one-time purchase

See this booklet pack →

PDF instructions only · Building parts not included

Individual build booklets are free ↗

More building guides