In the 1960s, a young woman nicknamed Babydoll is institutionalized by her abusive widowed stepfather at the fictional Lennox House for the Mentally Insane in Brattleboro, Vermont, after he murders her younger sister and frames her for the crime. He bribes asylum orderly Blue Jones to forge the signature of the asylum's psychiatrist, Vera Gorski, to have Babydoll lobotomized so she cannot inform authorities of the truth. During her admission to the institution, Babydoll takes note of four items that she would need to attempt an escape.
Babydoll slips into a fantasy world in which she is newly arrived in a brothel owned by Blue, whom she envisions as a mobster, where she and the other patients are sex slaves. In this realm, she befriends four other patients/dancers: Amber, Blondie, Rocket, and Rocket's sister and "star of the show", Sweet Pea. Dr. Gorski is envisioned as the girls' dance instructor. Blue informs Babydoll that her virginity will be sold to a client known as the High Roller, who is actually the doctor scheduled to perform her lobotomy. Gorski encourages Babydoll to perform an erotic dance, during which Babydoll further fantasizes she is in feudal Japan, meeting the Wise Man. After she expresses her desire to "escape", the Wise Man presents Babydoll with weapons and tells her that she needs five items: a map, fire, a knife, a key, and a fifth unrevealed item that only she can find, which would require "a deep sacrifice" and bring a "perfect victory". She then fights three samurai giants. As her fantasy ends, she finds herself back in the brothel; her dance has impressed Blue and other onlookers.
Babydoll eventually convinces the four girls to join her in preparing an escape. She plans to use her dances as a distraction while the other girls obtain the necessary tools. During her dances, she imagines fantastic adventures that mirror the escape efforts. These adventures include infiltrating a bunker protected by steampunk-inspired World War I German soldiers to gain a map (mirrored by Sweet Pea copying a map of the brothel/institution from Blue's office); storming an Orc-infested castle to retrieve two fire-producing crystals from inside a baby dragon (mirrored by Amber stealing a lighter from the mayor's pocket); and boarding a train and fighting robotic guards to disarm a bomb (mirrored by Sweet Pea stealing a kitchen knife from the Cook's belt). During the last fantasy, Rocket sacrifices herself to guarantee Sweet Pea's escape from the bomb's blast, paralleled by the Cook fatally stabbing Rocket as she tries to protect her sister.
Blue overhears Blondie relaying Babydoll's plan to Gorski, confirming his suspicions that something is amiss. He locks Sweet Pea in a utility closet and confronts the other girls backstage. He fatally shoots Amber and Blondie, and attempts to rape Babydoll, but she stabs him with the kitchen knife and steals his master key. Babydoll frees Sweet Pea and starts a fire to keep the orderlies occupied while they seek an exit. They escape into the courtyard, where a throng of men blocks their way. Babydoll deduces that the fifth item she needs is actually her own sacrifice, and that this is actually Sweet Pea's story. Despite Sweet Pea's protests, Babydoll insists on revealing herself to the visitors, thus distracting them long enough to allow her friend to slip away unnoticed.
Back in the asylum, the surgeon has just performed Babydoll's lobotomy. Gorski notes that during her short stay, the girl stabbed an orderly, started a fire, and helped another girl escape the asylum. The surgeon is baffled by Babydoll's expression, and asks Gorski why she authorized the procedure, and many identical ones before. Gorski realizes that Blue has been forging her signature and summons the police, who apprehend Blue as he attempts to sexually assault a lobotomized Babydoll. While being led away, Blue also incriminates the stepfather. Babydoll is shown smiling serenely.
At a bus station, Sweet Pea, having stolen a dress to better blend in, gets stopped by police as she tries to board a bus to Fort Wayne, but the bus driver (the Wise Man) rescues her by misleading the police and letting her board. She thanks him and he says they have "a long way to go" as the bus leaves.
During the end credits, Dr. Gorski and Blue sing "Love Is the Drug" as a duet in a glitzy musical sequence that includes dancing from all five female leads.
Emily Browning as Babydoll
Abbie Cornish as Sweet Pea
Jena Malone as Rocket
Vanessa Hudgens as Blondie
Jamie Chung as Amber
Carla Gugino as Vera Gorski / Madame Vera Gorski
Oscar Isaac as Blue Jones
Jon Hamm as The Doctor / The High Roller
Scott Glenn as The Wise Man / The General / The Bus Driver
Gerard Plunkett as The Stepfather / Priest
Patrick Sabongui as Earl
Malcolm Scott as The Cook