What the H and L screws do
The H and L screws are the two limit stops on a rear derailleur. The H screw stops the derailleur from moving outward too far, which would push the chain past the smallest cog. The L screw stops it from moving inward too far, which would push the chain toward the largest cog and the spokes.
Each screw is only one half of the setup. Get both right, and the derailleur can reach every cog without overshooting.
Take the cable tension out first
Set the limit screws with the cable tension out of the picture. Use the barrel adjuster on the shifter cable housing to take up or release the tension until the derailleur sits where it would with no cable pull. If you skip this step, a cable that’s pulling the derailleur inward or outward can make a wrong limit setting look correct.
Put the chain on the largest front ring for a two-ring setup, or the middle ring on a three-ring setup, before you start.
Set the H screw on the smallest cog
Shift the chain to the smallest rear cog. Start with the H screw turned in too far, so the derailleur can’t move outward past the cog. Then back the screw out slowly until the guide pulley sits directly below the smallest cog.
Once it’s lined up, tighten the screw about half a turn and test the shift. If the chain rubs on the next cog as you turn, back off until the noise stops. If two settings sound equally quiet, the tighter one is usually the better choice.
Set the L screw on the largest cog
Start with the L screw turned in too far, then back it out slightly. Shift the front to the next-to-largest ring and the rear to the second-largest cog, then shift the chain up to the largest cog, and watch for a clean, full shift.
If the shift is clean, click the shifter one step outward, turn the L screw in a little, and test again. Repeat until you see the too-tight signs: no shift, a slow shift, or noise on the largest cog. Then back the screw out a quarter turn and test once more.
Check the result with the shifter
With the chain on the smallest cog, push gently on the shifter lever. The derailleur cage should not move any further inward. If it does, the L screw needs another quarter turn of tightening, or the hanger may be bent.
With the chain on the largest cog, push gently on the shifter lever again, and check the derailleur doesn’t move any further toward the spokes.
Signs a setting is wrong
Too tight on the L screw: the chain won’t reach the largest cog, shifts slowly, or makes noise on it.
Too loose on the L screw: the derailleur can move too far inward, so the chain can catch between the cassette and the spokes. If that happens, stop riding and check the hanger first.
Too tight on the H screw: the chain won’t reach the smallest cog, or it shifts slowly into it.
Too loose on the H screw: the chain can run past the smallest cog and rub or drop.
Next steps after the limit screws
Once both screws are set, take up the cable slack and index the gears. The clicks should move the chain one cog at a time. Then set the B-screw if the shifting still needs a small change. Index rear derailleur gears covers the indexing steps in detail.