In the middle of World War II, two prisoners of war are burying a corpse in the graveyard of a Japanese POW camp in southern Burma. One, American Navy Commander Shears (William Holden
), is revealed to routinely bribe guards to ensure he is put on the sick list, which allows him to avoid hard labour.
A large contingent of British prisoners under the leadership of Colonel Nicholson (Alec Guinness
) arrives, defiantly whistling the Colonel Bogey March as they march in. Because they were ordered by their superiors to surrender, Nicholson states that they should be obedient and cooperative prisoners. The Japanese camp commander, Colonel Saito (Sessue Hayakawa
), addresses them, informing them of his rules. He insists that all prisoners, regardless of rank, will work on the construction of a bridge over the Kwai River as part of a railroad that will link all Burma.
The next morning, when Saito orders everyone, including officers, to work, Nicholson commands his officers to stand fast. He points out that the Geneva Conventions state that captured officers are exempt from manual labour. Saito is infuriated and backhands Nicholson in the face, but the latter refuses to back down, even after Saito has a machine gun set up threatening to shoot all the officers. Saito is dissuaded from shooting by Major Clipton (James Donald
), a British medical officer prisoner, citing an inquiry and scandal should Saito carry through with the murder of officers. Instead, the Japanese commander leaves Nicholson and his officers standing in the intense heat. As the day wears on, one of them collapses from heat stroke, but Nicholson and the rest are still standing defiantly at attention when the prisoners return from the day's work. After Colonel Nicholson is beaten in Saito's quarters, the British officers are sent into a punishment cage and Nicholson into his own box for solitary confinement.
When Clipton requests to be allowed to check the officers, Saito agrees on the condition that Clipton persuade Nicholson to change his mind. Nicholson, however, refuses to budge, saying "if we give in now there'll be no end to it." In the meantime, construction of the railroad bridge falls far behind schedule, due in part to many "accidents" purposely arranged by the British prisoners.
Saito has a deadline; if he should fail to meet it, it would bring him great shame and oblige him to commit seppuku (ritual suicide). Saito reluctantly releases Nicholson, telling him that he has proclaimed an "amnesty" to commemorate the anniversary of Japan's great victory in the Russo-Japanese War, using it as an excuse to exempt the officers from work. Upon their release, Nicholson and his officers proudly walk through a jubilant reception. Saito for his part breaks down in tears in private.
Having recovered from his ordeal physically, but not mentally broken, Nicholson sets off on an inspection of the bridge and is shocked to find disorganization, shirking and outright sabotage on the construction site. He decides that he will build a better bridge than the Japanese soldiers. He orders Captain Reeves (Peter Williams
) and Major Hughes (John Boxer
) to come up with designs for a proper bridge, despite its military value to the Japanese. He wants to demonstrate to his captors what he considers superior British ingenuity and to also keep his men busy, which he feels would be better for morale than sitting around doing nothing in prison.
Meanwhile, three men, one of them the American Shears, attempt to escape. Two are killed; Shears is shot, falls into the river and is swept downstream. After many days in the jungle, he stumbles into a Siamese village, whose residents help him recover and get back to safety. He's given food, water and an outrigger boat to make his way down the river. Shears runs out of water during the trip and is forced to drink the water from the river, which makes him ill. However, he makes it to the mouth of the river and is picked up by British forces and shipped to a British hospital in Colombo, Sri Lanka (at the time, Ceylon). While recuperating, he dallies with a lovely nurse (Ann Sears
Major Warden (Jack Hawkins
), a member of the British Special Forces, asks to speak with him. He informs Shears that he is leading a small group of commandos on a mission to destroy the Kwai bridge. He asks Shears to volunteer, since he knows the area. Shears refuses, finally admitting that he is not Commander Shears at all, but a Navy enlisted man. Shears recounts that he and a Navy Commander survived the sinking of their ship, but the Commander was subsequently killed by a Japanese patrol. "Shears" switched dog tags with the dead officer, hoping to get preferential treatment in captivity. It didn't work, but then he had no choice but to continue the impersonation. Warden tells him that the military already knew about it. To avoid bad publicity, the U.S. Navy loans him to the British. Warden offers him a deal: in exchange for his services, he will be given the "simulated rank" of major on the mission and avoid being charged with impersonating an officer, an offense punishable by death. Thus, Shears reluctantly "volunteers" with the understanding that should he survive, he'll get to keep his officer status. They are to be joined by Lieutenant Joyce (Geoffrey Horne
), a young eager officer with no combat experience who insists that he won't fold under pressure should he have to kill someone on the mission, and a fourth officer.
Back in the camp, Nicholson explains to the Japanese through engineering principles that they've selected a poor site for the bridge. Finally convinced, the original bridge is abandoned and construction of a whole new bridge is commenced 400 yards downriver. Clipton watches in bewilderment as Nicholson maniacally drives his men to complete the project by the deadline. Ironically, he even volunteers his junior officers to assist with the physical labor, something he had refused to consider earlier in the standoff with Saito - provided that the Japanese officers are willing to pitch in as well.
Meanwhile, the commandos parachute in. The fourth officer dies due to a bad landing. The rest make their way to the river, assisted by native Burmese women porters and their village chief, Yai (M.R.B. Chakrabandhu
). The commandos come upon a Japanese patrol whom they try to kill without firing shots, but Joyce freezes when confronted by one in the jungle. Warden jumps in front of him and kills the Japanese soldier, but gets shot in the foot as a consequence. This slows him down, but Shears refuses to leave him behind and the trio make their way to the bridge with the Burmese helpers.
As the prison camp celebrates the completion of the bridge on time with a party for all, Shears and Joyce wire explosives to it under cover of darkness. The next day, a Japanese train full of soldiers and important officials is scheduled to be the first to use the bridge; Warden wants to blow it up just as the train passes over, accomplishing two missions at once.
As dawn approaches, the trio notice with horror that the river has receded and the wires and explosives that were hidden the night before are now exposed. Nicholson proudly walks up and down his bridge making a final inspection, and notices the wires. The train can be heard approaching. Nicholson and Saito frantically hurry down to the riverbank, pulling up and following the wire towards Joyce who is waiting by the detonator. When they get too close, Joyce breaks cover and stabs Saito to death. Nicholson yells for help and then tries to stop Joyce (who cannot bring himself to kill Nicholson) from getting to the detonator. A firefight erupts as Warden fires upon the approaching Japanese soldiers; Yai is killed in the gunfight. When Joyce is hit, Shears swims across the river to finish the job, but he too is shot just before he reaches Nicholson.
Recognizing Shears, Nicholson suddenly comes to his senses and exclaims, "What have I done?" Warden desperately turns the mortar fire in their direction, killing Shears in the blast and mortally wounding Nicholson. The colonel stumbles over to the detonator plunger and falls on it with his dying breath, just in time to blow up the bridge and send the train hurtling into the river.
Warden, feeling guilty for killing Shears and Nicholson in the face of shocked stares from the Burmese women, pleads, "I had to do it! They might have been taken alive! It was the only thing to do!" Meanwhile, Major Clipton, the British medical officer who has witnessed all the carnage unfold from his vantage point on the hill, shakes his head incredulously, "Madness! ... Madness!".