Director Christopher Nolan came upon the idea after he and his wife Emma Thomas sailed across the English Channel to Dunkirk. Nolan wrote the seventy-six-page screenplay, about half the length of his usual scripts, and his shortest to date. It was written with a precise mathematical structure. Nolan decided to make the film as a triptych, told from three perspectives – the land, sea, and air. Nolan structured the story from the point of view of the characters, with the intention that most of it was to be told visually, which meant doing away with dialogue and backstory. The entire film was made to encompass the snowball effect that had only been used in the third acts of his previous films. He approached the research as though it were for a documentary film. What made the project attractive to Nolan was its inherent contradiction to Hollywood formula, as the Battle of Dunkirk was not a victory, did not involve America, and yet demanded a big-scale production to be put on screen. Nolan decided to postpone Dunkirk until he had plenty of experience directing large-scale blockbuster action films. Nolan then found inspiration in Intolerance: Love's Struggle Throughout the Ages (1916), Greed (1924), Sunrise (1927), All Quiet on the Western Front (1930), Foreign Correspondent (1940), The Wages of Fear (1953), A Man Escaped (1956), Pickpocket (1959), The Battle of Algiers (1966), Ryan's Daughter (1970), Alien (1979), Chariots of Fire (1981), Speed (1994), Saving Private Ryan (1998) and Unstoppable (2010). Author Joshua Levine served as the film's historical consultant. Levine accompanied Nolan while interviewing veterans. During these interviews, Nolan was told a story of soldiers who were observed walking into the sea in desperation and incorporated it into the screenplay. Nolan and his production designer Nathan Crowley toured the beach while location scouting, having decided to film there despite the logistical challenges of shooting on-location.
Tom Hardy, Kenneth Branagh and Mark Rylance were in talks to join the ensemble as supporting characters in late 2015. Fionn Whitehead was cast as the lead in March 2016, while Jack Lowden, Aneurin Barnard and Harry Styles were added to the list shortly after. Cillian Murphy joined the following month. James D'Arcy, Barry Keoghan and Tom Glynn-Carney were included in the line-up later that May. After first-hand accounts of the Dunkirk evacuation revealed to Nolan how young and inexperienced the soldiers were, he decided to cast young and unknown actors for the beach setting. Principal photography commenced in late May 2016. Filming took place in the same location as the real historical evacuation, as well as Urk, Netherlands; Swanage and Weymouth in Dorset, United Kingdom, and the Point Vicente Interpretive Center and Lighthouse in Rancho Palos Verdes, United States. Around six thousand extras were used as soldiers during the shoot. The film was shot on a combination of IMAX 65 mm and 65 mm large format film stock in Panavision System 65, with more IMAX footage shot than in any of Nolan's previous films – an estimated seventy-five percent. Panavision and IMAX lenses provided the ability to shoot at night. For the first time in a feature film, IMAX cameras were used in a hand-held capacity. Nolan, with the aid of Marine coordinator Neil Andrea, Nolan had located and reconditioned up to sixty actual warships, twelve actual civilian boats and several actual planes during the course of filming. All of which was done to avoid the use of computer-generated imagery and to contribute to the realism.
For Post-Production, Nolan's regular collaborator Lee Smith assembled the shots unsupervised while filming was still in progress. Editing took place in Los Angeles, composed of an audio mixing team of eight people. Nolan said of the process, "You stop seeing the wood for the trees", concluding that detail was its most predominant purpose. Nolan singled out the editing of aerial sequences as a particular challenge, likening them to a chess game. Double Negative underwent the visual effects work while FotoKem, which also assisted as the production's film laboratory, handled the release prints. By January 2016, composer Hans Zimmer had already begun working on the score. For the purpose of intensity, the script was written to accommodate the auditory illusion of a Shepard tone, which had previously been explored in Nolan's 2006 film The Prestige. This was coupled with the sound of a ticking clock, that of Nolan's own pocket watch, which he recorded and sent to Zimmer to be synthesised.
The film stars Fionn Whitehead, Tom Glynn-Carney, Jack Lowden, Harry Styles, Aneurin Barnard, James D'Arcy, Barry Keoghan, Kenneth Branagh, Cillian Murphy, Mark Rylance, and Tom Hardy. The cast gave terrific performances no matter how small the part or the amount of lines given. They gave so much with so little.