In early 1943, British PO Ws arrive by train at a Japanese prison camp in Burma. The commandant, Colonel Saito, informs them that all prisoners, regardless of rank, are to work on the construction of a railway bridge over the River Kwai that will connect Bangkok and Rangoon. The senior British officer, Lieutenant Colonel Nicholson, informs Saito that the Geneva Conventions exempt officers from manual labour. Nicholson later forbids any escape attempts because they had been ordered by headquarters to surrender, and escapes could be seen as defiance of orders.
At the morning assembly, Nicholson orders his officers to remain behind when the enlisted men march off to work. Saito threatens to have them shot, but Nicholson refuses to back down. When Major Clipton, the British medical officer, warns Saito there are too many witnesses for him to get away with murder, Saito leaves the officers standing all day in the intense heat. That evening, the officers are placed in a punishment hut, while Nicholson is locked in an iron box.
Meanwhile, three prisoners attempt to escape. Two are shot dead, but United States Navy Commander Shears gets away, although badly wounded. He stumbles into a village of natives, who nurse him back to health and then help him leave by boat.
Meanwhile, the prisoners work as little as possible and sabotage whatever they can. Should Saito fail to meet his deadline, he would be obliged to commit ritual suicide. Desperate, he uses the anniversary of Japan's victory in the Russo-Japanese War as an excuse to save face and announces a general amnesty, releasing Nicholson and his officers and exempting them from manual labour.
Nicholson is shocked by the poor job being done by his men. Over the protests of some of his officers, he orders Captain Reeves and Major Hughes to design and build a proper bridge to maintain his men's morale. As the Japanese engineers had chosen a poor site, the original construction is abandoned and a new bridge begun downstream.
Shears is enjoying his hospital stay in Ceylon when British Major Warden invites him to join a mission to destroy the bridge before it is completed. Shears is so appalled, he confesses he is not an officer; he impersonated one, expecting better treatment from the Japanese. Warden responds that he already knew and that the American Navy agreed to transfer him to the British to avoid embarrassment. Shears could also be charged with impersonating an officer. Realising he has no choice, Shears volunteers. Warden, Shears, and two other commandos - Joyce and Chapman, will parachute into the jungle and destroy the bridge.
Meanwhile, Nicholson drives his men hard to complete the bridge on time. For him, its completion will exemplify the ingenuity and hard work of the British Army long after the war's end. When he asks that their Japanese counterparts pitch in as well, a resigned Saito replies that he has already given the order. Clipton expresses grave doubts about the sanity of Colonel Nicholson's efforts to build the bridge in order to show up his Japanese captors.
The four commandos parachute in, though Chapman is killed on landing. Later, Warden is wounded in an encounter with a Japanese patrol and has to be carried on a litter. He, Shears, and Canadian Lieutenant Joyce reach the river in time with the assistance of Siamese women bearers and their village chief, Khun Yai. Under cover of darkness, Shears and Joyce plant explosives on the bridge towers below the water line.
A train carrying important dignitaries and soldiers is scheduled to be the first to cross the bridge the following day, so Warden waits to destroy both. However, by daybreak the water level has dropped, exposing the wire connecting the explosives to the detonator. Nicholson spots the wire and brings it to Saito's attention. As the train approaches, they hurry down to the riverbank to investigate.
Joyce, manning the detonator, breaks cover and stabs Saito to death. Nicholson yells for help, while attempting to stop Joyce from reaching the detonator. When Joyce is mortally wounded by Japanese fire, Shears swims across the river, but is himself shot. Recognising the dying Shears, Nicholson exclaims, "What have I done?" Warden fires a mortar, wounding Nicholson. The dying colonel stumbles towards the detonator and collapses on the plunger just in time to blow up the bridge and send the train hurtling into the river below. Warden turns toward the only survivors of the commando raid, the women bearers, and begs their forgiveness for having to kill Joyce and Shears, and throws the mortar launcher away in disgust, and prepares to leave. Clipton, observing the carnage, shakes his head muttering, "Madness!, Madness!".