Published: September 30, 2026

What is deus ex machina?

Deus ex machina is when a seemingly hopeless problem in a story is solved by a sudden outside intervention that was never set up. It's Latin for 'god from the machine', named after the god figures lowered onto the stage by crane in ancient Greek theater.

Where the term comes from

In ancient Greek theater, some plays resolved a tangled plot with a god lowered onto the stage by a mechanical device. Over time the term came to mean any resolution that doesn't come from within the story, one that 'falls from the sky'.

Why readers dislike it

Tension comes from the reader wondering whether the characters will find a way out. When an unannounced power, coincidence or character solves the problem, the characters' struggle becomes meaningless and the reader feels cheated.

How to avoid it

Plant the seeds of the solution early: show the saving skill, ally or item early in the story, without drawing attention to it at the time. Tie the resolution to the characters' own choices and the price they pay. A rule should only be used for a solution if the reader already knows it, which is closely related to the Chekhov's gun principle.

The deus ex machina risk in worldbuilding

A magic system with vague rules is the easiest door to deus ex machina: any problem can be solved with 'a new spell'. Writing down the limits of magic and technology from the start avoids that trap. In yazar.io you can keep those rules in Lore records and individual spells with their costs and effects in the Spells section, making it easy to check whether a solution fits your world's rules.

Is every surprise ending a deus ex machina?

No. A surprise that was hinted at and grows out of the characters' actions is earned. Deus ex machina is a solution with no setup inside the story.

Can it be used on purpose?

Yes. Some comedies and parodies use it deliberately and in an exaggerated way. The problem is when a writer reaches for it unknowingly to escape a dead end.

Are deus ex machina and Chekhov's gun related?

Yes, they're almost opposites. Chekhov's gun is about a shown detail paying off; deus ex machina is about something never shown solving the problem.

Start building your world on yazar.io

Bring your characters, locations, and every thread of your world together in one place; no credit card required.