Every cyclist gets a flat tire1 once in a while. The good news is that a prepared cyclist can easily fix the puncture and get back on his or her way quickly and without a lot of bother. Once you learn to patch a tube, you can travel as far as your pedals can take you (assuming no other mechanical difficulties).
The Tire/Tube/Wheel Combination
Most bicycles, whether road, off-road, or cruisers, use clincher tires. The clincher system has a thick rubber tire that fits into the rim of the wheel. The tire contains an inner tube which holds air under pressure. Air enters the tube through a valve, of which there are two kinds, Presta and Schraeder2. The inside of the rim is covered in rim tape so that the nipples of the spokes don't poke holes in the tube. The edges of the tire are lined with wires to hold onto the rim; this is called the bead.
Your Tool Kit
Your tool kit should include at a minimum the tools you need to fix a flat tire on your bicycle and not much more than that. You can get a nifty little under-saddle bag to stow these things in, or you can keep them in a jersey pocket, or in the bottom of your rucksack or panniers. The tool kit should comprise:
A pump set up to inflate the kind of valve--Presta or Schraeder--that your wheels have
Tire levers, which help lift the bead off of the rim
A patch kit, with extra patches, rubber cement, and a piece of sandpaper or a buffer
A small piece of tough fabric (denim or canvas), about 1 inch (2.5 cm) square, to place underneath a big gash in the tire
A spare tube or two with the same valve as the one already in your tire
A 15mm or adjustable wrench, if your axle does not have quick-release levers
A pocketknife, the blade of which can be used to release air from Schraeder valves
Different Kinds of Flats
Most flats are caused by a sharp object that sticks in your tire and punctures the tube. This happens more often on wet days than on dry ones, because the water and oil on the road make things, even sharp things, stick to your tire. Sometimes you get pinch or snakebite flats, where the tube is compressed and rips in two places. This means that all the air goes immediately out of the tube. You can try to avoid snakebites by keeping your tires at full inflation (listed on the tirewall) and by avoiding riding over deep potholes or trenches (because riding over the edge of the far side of the trench can compress your rear tire).
Your tube can also burst, leaving a huge irreparable rent in it, if the tube gets improperly caught in the rim, or if you overinflate the tube, or if you leave your bike in focused direct sunlight3. If the tube bursts, you have to replace it with a new one.
Fixing the Flat
Use the tire levers to pry the tire off the rim4. Keep one bead of the tire within the rim to keep the tube and wheel aligned. Use only tire levers and not screwdrivers or your pocketknife for this task so that you don't scratch up or deform the rim.
Starting opposite the valve, pull the tube slightly out of the tire. Don't go all the way; keep the tube near the corresponding part of the tire so that you can find the object that caused the puncture. If you are just going to put on a new tube, omit the next two steps, but don't forget to find the sharp thing in your tire, or else you will be changing your tire again all too soon. One Researcher reminds us:
Inflate the tube slightly using the pump. Go around the entire tube to look for the puncture. It is actually easier to hear the whoosh of escaping air or to feel the air on your cheek than to spot the hole visually; holding the tube next to your ear is a good tactic. If you cannot find the puncture, remove the tube entirely from the wheel, fill a basin with water, and submerge the tube (partial submersion works fine). You will see the bubbles of escaping air from the puncture.6
When you find the puncture, scrape the area around it with the buffer. This cleans the rubber and roughens it so that it takes the patch better. Cover the area with a big dollop of rubber cement (from the patch kit); make sure that the area covered is greater than the size of the patch. Larger holes need bigger patches. Wait about five minutes for the cement to dry.
While the cement is drying, look for the sharp object that caused the puncture. If you remember how the tube was lined up with the tire, it shouldn't be hard to figure out which section of the tire would have the thorn or piece of glass in it. Take a piece of cloth (or glove or shirt) and run it along the inside of the tire; it will stick on the protruding object that punctured the tube. Remove the object. If there is a large gash in the tire, place the fabric square between the tube and the tire under the hole in order to keep new debris from lodging in the hole and puncturing the tube again. If you have no piece of fabric, try a currency note instead.
By now, the cement should be dry. Peel the silver foil off of the patch and apply that side to the tire. Rub hard from the center toward the edges so that it sticks really well. Leave the cellophane on; it helps protect the patch.
Inflate the tube slightly and pack it back into the tire, starting at the valve, which you can line up with the tire label. Squeeze the bead of the tire back into the rim of the wheel. Inflate the tube a little more and make sure that the bead is within the rim all the way around. If it has slipped out anywhere your tube will be squeezed against the rim and will burst; you will then have to replace it with a new one.
Before fully inflating the tube, put the wheel back onto the bicycle by inserting the axle into the dropouts. When the wheel is fully in place, inflate the tire to the same pressure as the other tire on the bike. Do not use automobile-style air pumps available at filling stations; they are meant for larger tires and deliver air more quickly, which could burst your tube. Before you finish, tighten the bolts that hold the axle onto the bike by turning and flipping the quick-release levers or with your wrench.
I fixed a flat only for it to go again immediately I got on, simply because the shard of glass that caused the original puncture was still in the tyre!5
No Tube? Try This...
My grandad used to tell me stories about the 2nd world war and stuff but one story stuck with me. He used to tell me how he used to stuff his tires with grass, as he couldn't even afford inner tubes. I know its a last resort thing, and Ive not had to try it yet (touch wood) but I bet it works best on skinny tires.7
If you are in the city and there is no grass nearby, look around for broken or abandoned8 bicycles. You can ransack these for tubes; look for the valve sticking out of the rim before you remove the wheel and discover that someone has already taken the tube. Make sure that the valve fits your wheel; a Schraeder valve will not fit a Presta-drilled wheel. Another nifty last-ditch trick is to cut the tube at the hole and tie the two ends together and inflate that.
Do not attempt to ride on a flat tire. You may be able to roll forward, yes, but you are putting your tire and your rim at risk, and both of these cost more than a new tube.
Avoiding Flats Altogether
Keep your tires inflated to the proper pressure. The pressure is listed on the tirewall of each tire. In general, knobby mountain-bike tires are inflated to 40-45 psi, slick tires to 70-90 psi, and skinny racing tires to 115-120 psi. Air will leak from the tires slowly, so if you haven't ridden in a day or two, inflate tires to proper pressure before a ride. Regular cyclists are advised to invest in a decent floor pump: they are inexpensive and make inflating tires to the proper pressure a snap.
Also check your tires after a ride for sharp objects, particularly after riding through patches of glass or thorns and after wet days. Objects can lodge in the tire harmlessly at first. After several more miles of riding, they may, however, work through the tire and puncture the tube.
Thornproof tubes are available and are moderately effective; the downside is that they are much heavier and more expensive than ordinary tubes. They are not completely impervious, however; screws and nails will puncture them. Thornproof tubes can be temporarily patched with ordinary patches, though, so keep the patch kit handy just in case.
Some bike shops also sell plastic strips that go inside the tire to keep sharp objects from puncturing the tube; these may, however, rub against the tube and cause friction flats. For restaurant-delivery riders and other people who literally cannot afford to patch or change a tube, solid-plastic tires are available at some shops. These have no air inside them so cannot go flat. The drawback is that they are heavy and noisy and the plastic does not give as smooth a ride as the inflated tube.9
Chemical products also exist to address this problem. One kind of aerosol is called Slime. It adds a self-sealing layer to the inside of the tube so that any puncture will close itself up and can be applied either preventatively or after the puncture. Its drawback, according to one Researcher, is that "it kills the inner tube within 12 months, after the slime goes hard.10" Another Researcher reports success with a self-sealing product meant for automobile tires, she advises, "Just don't put too much in because as a byproduct, the reaction produces air to inflate the tire11."