Did you know…
Why do planes zig zag?
Short answer
Airliners rarely fly perfectly straight because they follow published airways and waypoints, deviate around thunderstorms and turbulence, and are vectored by air traffic control for spacing. A great-circle route also looks curved on a flat map. Genuine zig-zags are usually holds, weather deviations or test and survey flights.

Straight lines that are not straight
On a flight-tracking map an airliner rarely draws a clean line between two cities, and several unrelated things are usually behind the kinks. The first is the map itself. The shortest path between two points on a sphere is a great circle, and on the flat Mercator projection used by most apps that path appears as an arc bending toward the pole. A flight from London to Los Angeles that seems to swing far over Greenland is in fact taking the direct route.
The second is the route structure. Aircraft file a flight plan built from published waypoints and airways, and the network of waypoints does not always line up with the direct track. Crossing an ocean, flights follow organised tracks that are redrawn every day to ride the jet stream or avoid a headwind; a longer path through faster-moving air can save fuel and time. Over land, military airspace, national borders and busy terminal areas all push routes sideways.
Weather and traffic
The sharper turns are mostly weather. Pilots use onboard radar to steer around thunderstorm cells, and a deviation of 20 or 40 km (10–20 NM) around a line of storms looks like a large detour when drawn at continental scale. Areas of reported turbulence, icing or volcanic ash are avoided the same way. Air traffic controllers also issue headings, called vectors, to sequence arrivals or keep two aircraft separated, and each instruction adds a small dogleg.
Near an airport the pattern becomes deliberate. A holding pattern is a racetrack-shaped loop flown while waiting for a landing slot, and an approach often involves a downwind leg, a base leg and a turn onto final, all of which look like zig-zags from above.
When the zig-zag is the mission
Some aircraft really do fly back and forth on purpose. Survey and mapping flights fly parallel lines, a pattern known as mowing the lawn, so that cameras or sensors cover an area systematically. Search-and-rescue aircraft do the same to comb the sea. Test flights, calibration flights for navigation aids and training sorties also produce orderly loops and switchbacks. Fighters and aerobatic aircraft manoeuvre by nature, and an airliner that turns repeatedly at low altitude may be burning fuel to get down to its maximum landing weight before returning with a technical problem.
Watch for the context: a gentle curve is geometry, a cluster of small turns near storms is weather, and a neat lattice over the sea is someone looking for something.
More questions

Physics of flight
Why can't a Corsair pilot apply full power when going around after a failed carrier landing?
Because at low speed and high power the Corsair would drop its left wing suddenly and with almost no warning, due to propeller torque. If the throttle was… more…

Physics of flight
What did the phrase "banking with intent to turn" mean among F-104 pilots?
It was a joke among Canadian F-104 pilots: banking the aircraft "with intent to turn" referred to its poor low-speed turning. Its sustained turn capability… more…

Julian Herzog (Website) (CC BY), vía commons Physics of flight
What is "flight envelope protection," which the A320 pioneered?
A set of limits embedded in the flight control software: it calculates the flight envelope, adds a safety margin, and blocks pilot inputs that would take the… more…

Julian Herzog (Website) (CC BY), vía commons Physics of flight
What is the A320's SHARP package for?
SHARP (SHort AiRfield Package) improves takeoff and landing performance on short runways and is designed to increase low-speed lift. It combines aerodynamic… more…

Physics of flight
What flaw sank Vought's all-metal V-141 fighter?
It wasn't a single flaw: tests showed the V-141 still flew poorly, was prone to spinning, and also suffered tail flutter, which is why it was rejected. It… more…

Physics of flight
What wind tunnel did NACA use to study the Corsair, and how big was it?
The full-scale 30- by 60-Foot Tunnel at the Langley Research Center, in Hampton, Virginia. NACA dedicated the facility on 27 May 1931 and used it to test the… more…