A deus ex machina is a plot device in which an unexpected, poorly set up event or character resolves a seemingly unsolvable conflict, arriving from outside the story’s established logic rather than growing out of it. The term is Latin for “god from the machine,” referring to a literal stage mechanism used in ancient Greek theatre to lower an actor playing a god onto the stage, who would then resolve whatever problem the mortal characters couldn’t.
What Makes Something a Deus Ex Machina
The defining feature isn’t convenience alone; most endings resolve conflict in some way. It’s that the resolution has no groundwork in the story that precedes it. A rescue that arrives because of a skill or relationship the reader was never told the protagonist had, a sudden change of heart in a character with no established reason to change, information that surfaces at exactly the right moment with no explanation for how or why: these read as the author intervening from outside the story rather than the story resolving on its own terms.
This is closely related to what’s sometimes called reverse Chekhov’s Gun: a payoff with no gun ever shown on the wall.
Why It Undermines a Story
Tension in fiction comes from genuine uncertainty about whether a character can solve their own problem, using their own resources, established earlier in the story. A deus ex machina removes that uncertainty retroactively. It tells the reader, after the fact, that the tension they’d been invested in was never really at stake, because the solution was always going to arrive from somewhere outside anything the protagonist did or the story set up. Readers tend to feel this even when they can’t immediately name what went wrong; it registers as the ending being unearned.
Examples of the Pattern
A character trapped with no way out, until an unnamed, previously unmentioned relative arrives to save them. A villain defeated not by the protagonist’s actions but by an unrelated accident. A seemingly unsolvable mystery resolved by a confession that arrives with no lead-up. In each case, the specific event isn’t the problem; a rescue, an accident, and a confession can all be perfectly good story beats. What makes them a deus ex machina is the absence of any setup connecting them to what came before.
How to Avoid Writing One
Solve problems using resources the story has already established. If your protagonist is going to be saved, the means of that rescue, a skill, an ally, information, should already exist somewhere earlier in the manuscript, even if its relevance wasn’t obvious at the time.
Let the protagonist’s choices drive the resolution. A story’s ending lands hardest when it’s a direct consequence of what the protagonist decided and did, not something that happens to them.
Foreshadow, even lightly. A detail doesn’t need to be heavily emphasised to count as setup; even a passing, easy-to-miss mention earlier in the story is often enough to make a later payoff feel earned rather than arbitrary on a reread.
Ask whether the ending would still work if the convenient element were removed. If your climax depends entirely on something arriving from outside the established story, worth treating that as a sign the resolution needs to be rebuilt from something already in play.
Final Words
Not every convenient or surprising plot turn is a deus ex machina. The test is whether the story did the work beforehand to make it possible, or whether the resolution simply arrived because the plot needed it to. An ending can be dramatic, sudden, even improbable, and still feel earned, as long as the reader can trace it back to choices and details the story actually gave them.
Related reading:
The writing app built for novelists.
Plot, draft, edit, and format your manuscript in one private, local app for Mac. Free to download. Nothing leaves your Mac unless you choose to sync it.
macOS 13 Ventura or later · No account required