Around eight vehicles collided on the motorway in Buckinghamshire at around 8.15am on Sunday.
Thames Valley Police said a woman in her sixties and a man in his seventies died at the scene.
Their next of kin have been informed.
Two of the twelve injured were left seriously injured and remain in hospital. The remaining ten sustained “minor injuries”, some of whom were taken to hospital for additional checks.
National Highways said the M40 would be shut southbound between junctions four and five for a “considerable time”.
“Due to the nature of the incident, the closure is expected to be protracted,” it said.
The northbound carriage was also closed but reopened at around 11.30am.
Detective Chief Inspector Mike Bettington, of Thames Valley Police, said: “Our thoughts remain with the family and friends of the two people who died.
“We are appealing to anyone who may have witnessed the collision, or who may have dash-cam footage, to please get in touch.”
Anyone with dash-cam footage is asked to call 101 or make a report online, quoting reference 43230032159.