Having wasted an enormous amount of resources on recapturing escaped Allied prisoners of war (POWs), the Germans move the most determined and capable escapees to a new, high-security prisoner of war camp. The commandant, Luftwaffe Colonel von Luger, tells the Senior British Officer (SBO) Group Captain Ramsey, "There will be no escapes from this camp." The SBO replies that it is their duty to try to escape. After several failed escape attempts on the first day, the POWs settle into the prison camp.
Gestapo and SS agents bring Squadron Leader Roger Bartlett (RAF) to the camp and deliver him to von Luger. Known as "Big X," Bartlett is the principal organizer of escapes and Gestapo agent Kuhn suggests that he be kept under the strictest security confinement permanently, something which von Luger, who is contemptuous of the Nazis, will only make a "note" of. As Kuhn leaves, he warns Bartlett that if he escapes again and is caught, he will be shot. Afterward, Bartlett is put with the rest of the POWs.
Locked up with "every escape artist in Germany", Bartlett almost immediately plans the greatest escape attempteda tunnel system for breaking out 250 prisoners. The intent is to "confuse and harass the enemy" to the point that as many troops and resources as possible will be wasted on finding and detaining POWs, instead of being used on the front line.
Teams are organized to tunnel, make civilian clothing, forge documents, procure contraband materials, and prevent the guards from discovering their work. Flight Lieutenant Hendley, an American in the RAF, is "the scrounger" who finds ingenious ways to get what the others need, from a camera to identity cards. Australian Flying Officer Louis Sedgwick, "the manufacturer," makes many of the tools, such as picks for digging and bellows for pumping air into the tunnels. Flight Lieutenant Danny Velinski and William "Willie" Dickes are "the tunnel kings," and are in charge of making the tunnels. Eric Ashley-Pitt of the Royal Navy devices a method of hiding bags in the prisoners' trousers and spread the dirt from the tunnels over the prison camp, literally under the guards' noses. Forgery is handled by Flight Lieutenant Colin Blythe, who becomes nearly blind from intricate work by candlelight. Hendley takes it upon himself to be Blythe's guide in the escape.
The prisoners work on three tunnels simultaneously, codenamed "Tom," "Dick," and "Harry." Work on Harry and Dick is stopped so that more work can be performed on Tom. The worst of the work noise is covered by the prisoner choir led by Flight Lieutenant Cavendish, while dirt from the tunnels is concealed by POWs who carry excavated soil in their trousers to the camp's gardens.
Meanwhile, USAAF Captain Virgil Hilts, "The Cooler King," irritates the guards with frequent escape attempts and irreverent behavior. His first attempt, conceived while in the cooler, is a short tunnel with RAF Flying Officer Archibald Ives; they are caught and returned to the cooler.
While the mostly British POWs are enjoying a 4 July celebration, organized by the three Americans in the camp, the guards discover tunnel Tom. The mood drops to agonizing disappointment, and hits Ives the hardest. He is impulsively drawn to the barbed wire fence that confines them in the camp and climbs it in desperation, in full view of the tower guards. Hilts runs to stop him but is too late, and Ives is machine-gunned dead near the top of the fence. With Tom discovered, the prisoners switch their efforts to Harry.
After the death of Ives, Hilts's escape partner, Hilts agrees to a previous request made by Bartlett, to change his escape plan and reconnoiter in the vicinity outside the POW camp and then allow himself to be recaptured. The information Hilts brings back is used by POW cartographers to create maps of the area, including the nearest town and railway station.
End of the real "Harry" tunnel (on the other side of the road) showing how it doesn't reach the cover of the trees
The last part of the tunnel is completed on the night of the escape, but is 20 feet short of woods which are to provide cover. Danny nearly snaps from claustrophobia in the tunnel and delays those behind him, but is helped by Willie. Seventy-six escape before the guards discover the escaping prisoners.
After attempts to reach neutral Switzerland, Sweden, and Spain, almost all the POWs are recaptured or killed. Hendley and Blythe steal an airplane, intending to fly over the Swiss border, but the engine fails and they crash-land. Soldiers arrive on the road a distance away. Unaware of the soldiers, the blind Blythe stands in their view and when he turns away, he is shot. Hendley comes to his friend's aid, waving his hands and shouting "don't shoot", and is captured as Blythe dies. Flt. Lt. Cavendish, having hitched a ride in a truck, is captured at a checkpoint, discovering another POW, Haynes, captured in his German soldier disguise.
Bartlett is recognized at a distance in a crowded railroad station by Gestapo agent Kuhn. Another escapee, Ashley-Pitt, sees this and sacrifices himself when he kills Kuhn with Kuhn's own gun, and soldiers then shoot and kill him. In the commotion, Bartlett and MacDonald are able to slip away, but they are caught later. Lastly, Hilts steals a motorcycle, is pursued by German soldiers, jumps a barbed wire fence with the motorcycle to get away, but becomes entangled in another barbed wire fence and is captured.
Three truckloads of captured POWs go down a country road and split off in three directions. One of the trucks, containing Bartlett, MacDonald, Cavendish, and others, stops in a field and the POWs are told to get out and "stretch their legs." They are then shot dead with a machine gun. In total, 50 escapees are executed. Meanwhile, Hendley and nine others are returned to the POW camp. Von Luger is relieved of command and driven away by the SS to face the consequences of failing to prevent the breakout.
Only three escapees evade capture and make it to safety. Danny and Willie steal a rowboat and proceed downriver to the Baltic coast where they board a Swedish merchant ship. Sedgwick steals a bicycle, then rides hidden in a freight train boxcar to France where he is then guided by the Resistance to Spain.
Hilts is brought back alone to the camp, and taken to the cooler. A fellow POW gets Hilts's baseball and glove and throws it to him when Hilts and his guards pass by. The guard locks him in his cell and walks away, but momentarily pauses when he hears the familiar sound of Hilts bouncing his baseball against a cell wall. The film ends with this scene, under the caption, "This picture is dedicated to the fifty."