When a comedy character is upset, they'll lock themselves in the bathroom (or a bathroom stall) to escape the unpleasantness of dealing with what has made them upset. Alternately, a wanted character may lock themselves in the bathroom while being chased to avoid their pursuers. This is not an effective means of evading capture as bathroom doors are meant for privacy rather than as a physical barrier.
The character certainly can't stay inside forever, making this an unviable means of escaping their troubles in the long-term. Since bathrooms usually have only one door and no other means of egress, the other characters could effectively leave the upset individual alone and allow them exit when they ultimately become bored from the lack of attention.
As this would not be an entertaining solution, the other characters will attempt to coax them out using Closed Door Rapport. Sometimes, there are other circumstances requiring the troubled character's immediate removal to up the stakes, such as another character needing to use the bathroom. If negotiations break down, the frustrated onlookers may attempt to open the door with a Skeleton Key Card.
- Hiyokoi: It happens in the OVA during a sad panty shot incident during class. She (Hiyorin) felt so sad and embarrassed that she ran into the washroom. The poor girl!
- In a chapter of the Sgt. Frog manga, Keroro locks himself in the toilet to escape the wrath of Natsumi for messing with her favorite shirt.
- In the Archie Comics Sonic the Hedgehog continuity, during the "Mobius: 25 Years Later" arc, Lara-Su locks herself in the bathroom during an argument. She wants to become a guardian, but her parents are against it.
- In one Calvin and Hobbes strip, Calvin takes Rosalyn's science notes when she is babysitting him and locks himself in the bathroom with them, threatening to flush them down the toilet. Rosalyn ignores Calvin for a while and, thinking she has gone to call the fire department to axe open the door, he comes out to see the fire trucks.
- Lizzie locked herself in the bathroom once in For Better or for Worse when she was very young.
- The Iron Giant: Hogarth hides the giant's lost hand in the bathroom from his mother and Kent. After he gets it out the window, he pretends to be in the toilet when Mom and Kent force open the door.
- In a cross between this and Locked in a Room, in Can't Hardly Wait Kenny (Seth Green) and Denise (Lauren Ambrose) lock themselves in the upstairs bathroom...and can't get out because the door's broken.
- Going Overboard: Dickie Diamond locks himself in a bathroom because he felt like he's going to puke. After that, he just stays there locked, but later on, the door opens and Dickie is so happy to reclaim his job as a comedian.
- In Neil Simon's Plaza Suite, a bride with cold feet locks herself in the hotel bathroom on her wedding day.
- In The Room, Johnny locks himself in the bathroom after his birthday party when he discovers his girlfriend and best friend have been having an affair.
- The Shining: Wendy locks herself in the bathroom to hide from the now (literally!) Ax-Crazy Jack. The lock holds. The door doesn't.
- Junie B. Jones: In Yucky Blucky Fruitcake, Junie B. locks herself in the bathroom to pretend throwing sponges at her principal at the school's carnival. She actually throws them at the toilet, but then they get stuck in the drain, causing the toilet to flood the bathroom by accident.
- In Komarr, Nikki locks himself in the bathroom and refuses to go to school the morning after he learns that he's a mutant; Miles ends up talking him out.
- This Alien Shore: While fleeing from the smugglers who gave her a ride and now plan to sell her, Jamisia hides in a public bathroom to change her clothes and cut her hair.
- Cheers had an episode where Frasier and Lilith have Sam and Diane over for a dinner party. The episode had several instances where one of them got offended and locked themselves in the bathroom. Near the end of the episode, Diane and Lilith both go in. Having had enough of this, Frasier locks the door from the outside, then invites Sam to join him in watching I, Claudius.
- DCI Banks: In "The Buried", DI Morton locks herself in a stall in the ladies room after she receives divorce papers from her husband. Banks somewhat timorously follows her in to find out what is wrong.
- Drake & Josh is a subversion. In the episode "Vicious Tiberius", the two titular characters are trapped in Mrs. Hayfer's bathroom, not because the door was locked, but because they were trying to avoid their aforementioned teacher's vicious pet rottweiler.
- Full House: The Season 3 episode "The Greatest Birthday on Earth" sees Jesse, Stephanie and Michelle accidentally get locked in a gas station bathroom while on the way home for Michelle's third birthday party. "No more happy birthday to me?" Michelle asks when she realizes they might be trapped awhile.
- In The Golden Girls, Rose locks herself in the bathroom at a prestigious party after finding out that Blanche and Dorothy impersonated her date as a pen pal. Since she was occupying the only stall that wasn't out of order, a large group of attendees have gathered offscreen by the time Blanche and Dorothy coax her out.
- In Danish series Klovn, when Frank by accident doodles on Mia's croquis drawings, she gets unusually upset and locks herself into the bathroom. Frank lampshades it by saying that he didn't know women may actually lock themselves into the bathroom in real life when they are upset.
- Leave It to Beaver: The first-season episode "Child Care" sees a 4-year-old girl that Beaver and Wally are supposed to be watching lock herself in the bathroom. After an attempt by Beaver to have a friend try to unlock the door fails, they resort to calling the fire department. Wally and June learn about this and the boys eventually explain things (they held off for fear they might not get to babysit again), and the folks are mighty impressed things went so well.
- Leverage: In "The Fairy Godparents Job", Widmark locks himself in a bathroom stall while suffering from extreme stage fright. It is up to Sophie to talk him out so the con can go ahead.
- In the Monk episode "Mr. Monk Gets Cabin Fever," Stottlemeyer uses a set of handcuffs to lock Agent Grooms in the witness protection cabin's bathroom so Grooms cannot interfere while Monk, Natalie and Stottlemeyer leave to investigate a potential murder.
- Supernatural: In "The Devil You Know", Sam does this to Dean so he can slice on Brady.
- In Three's Company, Jack's date locks herself in the bathroom while Jack is having a food critic over for dinner. Mr. Furley, attempts to unlock the door with his credit card, but she takes it when he pushes it through the crack.
- In Red & Ted's Road Show, the trip to Atlanta is delayed when a worker gets trapped in a porta-potty. Red and Ted help blast him out with explosives.
***BOOM!*** Ted: "See, that didn't hurt a bit."
- DeliciousCinnamon: The gang theorizes that Dubz accidentally locked himself in Bert's bathroom during the Paper Mario stream.
- In the SuperMarioLogan episode, "Shrek's Bath Problem!", Mario is trapped in the bathroom with Shrek, who called him over in the first place because he pooped in the bathtub. The Brooklyn Guy shows up as a locksmith, but the lock is too complicated for him to figure out, so Toad slips a mini mushroom under the door, causing Mario to shrink and get out from under the door. At the end of the episode, Shrek opens the door easily by jiggling the doorknob.
- An accidental version of this trope happened to Soviet Womble in real life once, and he's coaxed into telling the mildly embarrassing story during a lull in one of his DayZ streams, which made it into one of his signature "Random Bullshittery" compilations. Apparently the passer-by who heard him shouting for help and called 999, because he lives alone apart from Lulu and didn't have his cellphone on him, told the dispatcher that a woman was trapped in an apartment. Soviet seemed more put out by the firefighters calling him "Ma'am" until he cleared up the misconception than anything else about a situation that's low-key Nightmare Fuel, at least in hindsight.
- In one episode of The Amazing World of Gumball, Gumball and Darwin literally get locked in the school bathroom. They decide to tell each other a secret they'd been keeping, but they're rescued by the janitor before Dawin can tell his. Gumball spends the rest of the episode being driven crazy by not knowing the secret, until Darwin tells him that he was only going to tell him because it looked like they were going to die. So, Gumball locks them in the bathroom again, only to find out that the secret Darwin had been keeping was that he didn't like some food Gumball made. They get out this time by flushing themselves down the toilet, arguing the whole way, finally ending by angrily yelling that they love each other.
- In the Chowder episode "The Vacation", Chowder, Mung, and Schnitzel end up getting locked in Chowder's bathroom. To make it worse, Chowder has a Potty Emergency, but can't go unless he's alone.
- The Daria episode "Through a Lens Darkly" sees Daria ditching her glasses in a moment of vanity. When Jane finds out, Daria locks herself in a stall in the girls' bathroom, upset at herself for this brief foray into narcissism.
- FETCH! with Ruff Ruffman: Happens to Ruff, Blossom and Chet in a Season 3 episode where Ruff's cousin, Roxie, lets a giant herd of sheep burst into the doghouse and stay.note This trope lasts for the majority of the episode.
- Kaeloo: In the Musical Episode, Mr. Cat steals a song Stumpy wrote for his girlfriend by making a Deal with the Devil and decides to turn it into a Broadway production. Stumpy locks himself in the bathroom and starts crying until Kaeloo and Quack Quack decide to help him, at which point he leaves the bathroom.
- Steven Universe: In the episode Catch And Release, Peridot locked herself in the bathroom while running from the Crystal Gems, intending a Bathroom Break-Out. She quickly discovered there was no other way out, and it became her new place of residence for a while. As an alien who doesn't eat or drink, she's unaware of the room's purpose.
- Subverted in The Wild Thornberrys. In the episode where Eliza finds herself in the Australian Outback, a ranger locks her in the bathroom so she does not cause any interference. Unfortunately, his parrot spoils his plan by revealing to others that she had been locked in the bathroom.