Whenever a character becomes upset at another character in a comedy, they'll usually lock themselves in the bathroom. Alternately, a character may lock themselves in the bathroom while being pursued to "escape" from their pursuers. The other characters will usually try negotiating with them to convince them to come out. Things usually get interesting if another character needs to use the bathroom.
In Real Life, the latter case is unlikely to offer the pursuee any protection depending on the reason he's being chased. Bathroom doors aren't meant to be much of a physical barrier and can be broken down with very little force. Plus, home bathroom doors usually have locks designed to be defeatable from the outside, by use of a small screwdriver, to prevent locking oneself out of the room. But on TV, the bathroom door is an impenetrable barricade. Once that door is closed, it can only be opened from the inside.
In a less dire case, such as a child having a tantrum, an effective solution would be to leave the upset individual alone and they'll get bored and come out eventually. Opening the door with an expired credit or gift card could also work if a more immediate solution is desired. But banging loudly on the door and shouting is way more fun!
- 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.
- 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 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 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.
- In Neil Simon's Plaza Suite, a bride with cold feet locks herself in the hotel bathroom on her wedding day.
- In The Kid, The Musical of the book by Dan Savage, the song "Terry..." is an attempt to coax Terry out of the bathroom after a fight.
- 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.
- The Shining: Wendy locks herself in the bathroom to hide from the now (literally!) Ax-Crazy Jack. The lock holds. The door doesn't.
- 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 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.
- 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.
- 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.
- 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.
- 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.
- In Three's Company, Jack's date locks herself in the bathroom while Jack is having a food critic over for dinner. Mr. Furley, the landlord, arrives, announces himself as the manager of the building and demands that she open the door. When she refuses, Mr. Furley attempts to unlock the door with his credit card, which she takes when he pushes it through the crack.
- 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.
- 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.
- 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.
- 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.
- 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 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."
- 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.
- DeliciousCinnamon: The gang theorizes that Dubz accidentally locked himself in Bert's bathroom during the Paper Mario stream.
- 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.
- 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 staynote . This trope lasts for the majority of the episode.
- 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.
- 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 an interference. Unfortunately his parrot spoils his plan by revealing that she had been locked in the bathroom.
- 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.