In episodic television, a bottle episode is produced inexpensively and restricted in scope to use as few non-regular cast members, effects, and sets as possible. Most bottle episodes are shot on sets already built for other episodes, frequently the main interior sets for a series, and consist largely of dialogue or scenes for which no special preparations are needed. They are also commonly used when a script has fallen through and another script has to be written on very short notice. 
The etymology of the phrase originates with a similar term used on the set of the original 1960s Star Trek. Cast and crew members of the show use the phrase "ship-in-a-bottle episodes" for episodes that took place only on board the Starship Enterprise.
Bottle episodes are sometimes produced when a show has a mid-season cliffhanger or an expensive season opener/closer, serving to allow as much of the budget as possible to go to the more expensive episodes. Scott Brazil, executive producer/director of The Shield, described bottle episodes as "the sad little stepchild whose allowance is docked in order to buy big brother a new pair of sneaks". The popularity of the Friends bottle episode "The One Where No One's Ready" led the producers to create at least one bottle episode in each subsequent season. Several early episodes of The X-Files were conceived as bottle episodes, including "Space", "Darkness Falls", and the well-received "Ice", although these often ran over budget nevertheless.
Bottle episodes from the Star Trek franchise are known for occasionally becoming among the most popular with fans. Prominent examples include "The Tholian Web", "Journey to Babel", and "Balance of Terror". The phenomenon has persisted to a lesser extent in later incarnations, with "Duet" (Star Trek: Deep Space Nine) being celebrated by Startrek.com and Amazon.com—among other sources—as "[a]rguably one of the best episodes of Deep Space Nine and a jewel in the entire Trek canon".
Although Star Trek is known for coming up with the term Bottle Episodes, it was not the first show to use them and not even the first Science Fiction Show. The third ever story of Doctor Who, "The Edge of Destruction" was a bottle episode created in different circumstances to most as the previous two stories had between them been eleven episodes and, as the series had not been formally picked up by the "BBC", a two part story was needed and no budget had been assigned. It only featured the four main cast.  Doctor Who has also had several bottle episodes.
On Breaking Bad, the third-season episode "Fly" features only two members of the main cast (plus a few extras) and takes place almost exclusively in the secret laboratory used to cook crystal methamphetamine. Series creator Vince Gilligan has referred to it as a bottle episode, noting that the limited setting and cast allowed for a slower pace and deeper exploration of character traits and motives:
Even if financial realities didn't enter into it, I feel as a showrunner that there should be a certain shape and pace to each season, and the really high highs that you try to get to at the end of a season — the big dramatic moments of action and violence, the big operatic moments you're striving for — I don't think would land as hard if you didn't have the moments of quiet that came before them. The quiet episodes make the tenser, more dramatic episodes pop even more than they usually would just by their contrast.
Miranda 's Season 2, Episode 5, "Just Act Normal", takes place entirely in a therapist's office and consists of only three main characters, one which makes a cameo at the end, and two guest stars.
An example of a bottle episode is Grey's Anatomy 's 250th episode, Guess Who's Coming to Dinner , features several members of the main cast, three guest stars and takes place mostly in Meredith Grey's home, during a dinner party.
Family Guy 's Season 8, Episode 17 "Brian & Stewie" takes place almost entirely with just two characters (Brian, the anthropomorphic dog, and Stewie, a troubled and intelligent baby) inside a bank vault for an entire weekend. The episode does begin with Brian and Stewie introducing the special story and ends with a few special re-run musical numbers. This example of a Bottle Episode wasn't for budgeting, but an experiment with both the two characters' relationship and the viewing audience. The characters' story easily wrote itself and the audience was very receptive of the special Bottle Episode and seemed to really enjoy another step in the development of the friendship between the two characters.
The season 1 finale of Married... with Children, entitled "Johnny Be Gone" takes place entirely in the Bundy's living room, as Al and Peg unsuccessfully attempt to leave for the "going out of business" party of their favorite burger joint, where the two first met.
A meta-example is Community 's Season 2, Episode 8 "Cooperative Calligraphy". After the opening, characters Jeff Winger (Joel McHale) and Abed Nadir (Danny Pudi) both refer to the situation as a bottle episode. The entire episode is set inside the college library with only the main cast.
There are also entire series that are essentially made up of bottle episodes such as Blackadder II. After the previous series, The Black Adder proved to be more expensive than the BBC wanted, to get the second series commissioned the writers Richard Curtis and Ben Elton arranged to cut every single expensive scene and to make the cheapest series possible.  Another earlier BBC series that is similarly almost entirely Bottle Episodes is Steptoe and Son.
- "10 great TV Bottle Episodes". 2012-11-21.
- "What is a Bottle Episode?". wiseGEEK. Conjecture Corporation. Retrieved 2013-10-26.
The term originates from Star Trek, where a number of episodes took the form of bottle episodes. The crew of the show came to refer to such episodes as 'ship in a bottle' episodes, referencing the fact that they typically took place on board the Starship Enterprise, and the term 'bottle episode' caught on more widely in the television industry. These episodes are also sometimes called 'bottleneck episodes,' referencing the constricted budget available to the crew.
- "Episode 410 "Back In The Hole"". fxnetworks.com. 2005-10-31. Archived from the original on 2005-10-31. Retrieved 2011-07-31.
- Bright, Kevin S. (2005). Friends: Final Thoughts (DVD). New Wave DVD and Warner Home Entertainment.
- Lowry, pp.121–122
- Edwards, p.71
- Goldman, p.94
- Edwards, p.45
- "Star Trek Database". Startrek.com. Retrieved 2010-08-29.
- "Star Trek - Deep Space Nine, Episode 19: Duet". Amazon.com. Retrieved 2010-08-29.
- "BBC - Doctor Who Classic Episode Guide - The Edge of Destruction - Details". bbc.co.uk.
- "News & Reviews: - Breaking Bad: "Fly" Review". Paczkowski.tumblr.com. Retrieved 2011-07-31.
- Murray, Noel (2010-06-13). "Interview with Vince Gilligan". The A.V. Club. Retrieved 2011-07-31.
- Framke, Caroline (2015-02-05). "Archer: "Vision Quest"". The A.V. Club. Retrieved 2015-02-08.
- "Blackadder II - Timewarp (Blackadder Hall)". Blackadder Hall.
- Edwards, Ted (1996). X-Files Confidential. Little, Brown and Company. ISBN 0-316-21808-1.
- Goldman, Jane (1995). The X-Files Book of the Unexplained Volume I. HarperPrism. ISBN 0-06-168617-4.
- Lowry, Brian (1995). The Truth is Out There: The Official Guide to the X-Files. Harper Prism. ISBN 0-06-105330-9.