(covers information from several alternate timelines)
A replicator, replicator system, replication system, or molecular synthesizer was a device that used matter-energy conversion technology similar to a transporter to produce almost anything from a ship's replicator reserves. (TNG: "Lonely Among Us", "Deja Q"; DS9: "Visionary"; VOY: "Virtuoso"; ENT: "Dead Stop") It was also capable of inverting its function, thus recycling the item. (DS9: "Hard Time", "The Assignment", "The Ascent", "Prophet Motive", "Nor the Battle to the Strong"; VOY: "Memorial", "Fair Haven", "Mortal Coil") Items thus disposed of served to fuel the replicator and could potentially become other items in turn. (VOY: "Year of Hell") A replicator that was installed primarily for the purpose of replicating food was referred to as a food replicator, food synthesizer, food dispenser, or food slot, while one installed for replicating beverages was referred to as a drink replicator.
Replicators were one of the technologies used in holodecks and holosuites, as well as in exocomps and self-replicating mines. (VOY: "The Cloud", "Twisted", "Dark Frontier", "Pathfinder", "Human Error"; TNG: "The Quality of Life"; DS9: "Call to Arms") They were commonplace among advanced Alpha Quadrant cultures like the United Federation of Planets, the Cardassian Union, and the Ferengi Alliance, but were largely unheard of in the Delta Quadrant, although a few species did possess them. (VOY: "False Profits", "State of Flux", "Caretaker", "Think Tank")
Replicators were capable of producing food as fresh and tasty as non-replicated foodstuffs, inorganically materialized out of patterns used by the transporters. (TNG: "Lonely Among Us") Most people found replicated foods and drinks to taste exactly the same as "real" food, although some people claimed to be able to tell the difference. Furthermore, Federation replicators could be programmed to produce foodstuffs of acceptable "nutritional value" despite resembling more indulgent items. (TNG: "The Price", "Sins of the Father", "The Wounded", "Relics"; DS9: "In the Pale Moonlight", "You Are Cordially Invited") Some people didn't learn to cook without a replicator. (TNG: "Family", "In Theory", "The Wounded"; VOY: "Human Error") Some smaller ships didn't bother to carry food or water, preferring to rely on their replicators to synthsize what they needed, which saved on space but caused problems if the replicator was damaged. (TNG: "Final Mission")
Once a meal was finished, the used dishes, utensils, and uneaten/inedible portions could be placed back inside the replicator to be automatically recycled.
Federation replicators often recycled waste produced by living beings - including fecal material - to provide the raw material for replicators. Such material was deconstructed down to the atomic level, and then recombined as needed into foodstuffs and other products. (DIS: "There Is A Tide...")
In addition to foodstuffs, replicators could be used for replicating an almost limitless range of other objects. Complex devices (TNG: "The Game", "The Child"; DS9: "Rivals", "Captive Pursuit"; VOY: "Phage", "The Killing Game", "Dark Frontier", "Tsunkatse"), weapons (DS9: "Civil Defense", "Inquisition", "Call to Arms"; VOY: "Counterpoint", "Flesh and Blood"), machine components (DS9: "Distant Voices", "Image in the Sand"; VOY: "Extreme Risk", "One Small Step", "Latent Image"), clothing (TNG: "The Survivors"; DS9: "Distant Voices", "Paradise"; VOY: "Caretaker", "Vis à Vis", "Someone to Watch Over Me", "Flesh and Blood"), medication (VOY: "Latent Image", "Fury", "Body and Soul"), coins (TNG: "The Game", "The Perfect Mate"), musical instruments (TNG: "The Neutral Zone", "Inheritance"), antique furniture (VOY: "Lineage"), photographs (VOY: "Human Error"), and a wide range of other items. Industrial replicators could even be used to replicate heavier machine parts, to help build factories, power plants etc. (DS9: "For the Cause")
Users could program their own replication patterns into the replicator, such as a particular recipe for soup, a larger duplicate of a complex item, or an unusual device such as a wheelchair. Worf programmed an approximation of bloodwine into the USS Enterprise-D's replicators. (TNG: "The Outcast", "Lessons", "Gambit, Part II"; DS9: "Rivals", "Melora", "Destiny"; VOY: "Fury", "The Voyager Conspiracy", "Once Upon a Time") Elim Garak would program replicator patterns for clothing as he designed it. (DS9: "Distant Voices") Replicators included built-in scanners, allowing someone to make copies of an item without understanding its internal workings. (DS9: "Rivals")
On some Starfleet vessels, the full range of meals programmed into replicators was limited to senior officers through the use of an access card, or certain areas only frequented by senior officers would have a replicator that could freely dispense higher quality recipes to anyone. Some types of meals were simply limited by volume, such as producing only one slice of pizza at a time. (LD: "Moist Vessel", "I, Excretus")
Starfleet replicator technology was theoretically capable of creating artificial substitutes for natural organs for use in certain transplants, such as eyes or lungs. (TNG: "Loud As A Whisper"; VOY: "Phage") A genetronic replicator could extrapolate actual organs for use in medical transplants from a DNA sample. (TNG: "Ethics")
Some alien replication technology was able to create living organic material, such as when the D'Arsay archive created living snakes. The "Allegiance" aliens were also able to create living things, as in the case of Jean-Luc Picard's impostor, for which the replicators were even able to recreate the dendritic connections where memory was stored. (TNG: "Masks", "Allegiance")
Replicators had limits to their functionality. If the object desired contained a certain degree of complexity in its molecular structure, it could not be replicated. (TNG: "The Enemy"; VOY: "Imperfection") Talaxian lungs were considered too complex to replicate, as Talaxian physiology included a complex series of neural links between the lungs and the rest of the body that replicators were unable to duplicate exactly. (VOY: "Phage") Certain medicatical compounds could not be replicated, nor could Cardassian plasma distribution manifolds (or rather the beta-matrix compositor used in making them), Borg cortical nodes, or bio-neural gel packs. (TNG: "Code of Honor"; DS9: "The Abandoned", "Empok Nor"; VOY: "Learning Curve", "Imperfection")
Certain materials, such as tricyanate and polyduranide, were considered difficult to replicate. (TNG: "The Most Toys"; VOY: "Scorpion", "Vis à Vis") For some reason, it took a long time to replicate nanoprobes. (VOY: "Scorpion", "In the Flesh")
Some citizens of the Federation, such as Robert Picard, refused to use replicators. Picard was opposed to their use and would not allow them on his property, complaining that they were destroying people's ability to cook, among other issues. (TNG: "Family") Similar but less extreme mindsets were not uncommon, and both Miles O'Brien's mother as well as Joseph Sisko raised their respective children believing that replicated food was less nutritious or generally "lacking". (TNG: "The Wounded"; DS9: "Homefront")
Some people claimed to be able to tell the difference between replicated and "real" food. Jean-Luc Picard admitted that their replicator did not do "justice" to caviar, so he kept some cases of it for special occasions. (TNG: "Sins of the Father") Worf claimed they did not do justice to Klingon Warnog. (TNG: "Rightful Heir") Aquiel Uhnari complained the Muskan seed punch she could replicate didn't match the sort her mother made for her. (TNG: "Aquiel") Eddington claimed that he could taste the fact his "curried chicken" was in reality "replicated protein molecules". (DS9: "Blaze of Glory") In 2366, Deanna Troi expressed her desire to the computer to have a "real" chocolate sundae. The computer wished for her to define "real in context", to which Troi explained, "Real. Not one of your perfectly synthesized, ingeniously enhanced imitations. I would like real chocolate ice cream, real whipped cream..." before she was interrupted by the computer explained that "[t]his unit is programmed to provide sources of acceptable nutritional value. Your request does not fall within current guidelines. Please indicate whether you wish to override the specified program?" (TNG: "The Price") In 2399, Troi and William T. Riker lived on Nepenthe, hunting and harvesting their own food, which matched well with Riker's interest in cooking. When Troi provided Soji Asha a ripe tomato from their garden, Soji was surprised by how "real" it tasted in the comparison to the replicated food she had eaten all of her life. (TNG: "Time Squared", "Remember Me"; PIC: "Nepenthe") Dr. Bruce Maddox apparently preferred to replicate all the ingredients for chocolate chip cookies, then mix and bake them himself. When Dr. Agnes Jurati asking why he hadn't just replicated the cookies themselves, Maddox explained that he disliked the replicated kind, and that there was an "alchemy" to it. (PIC: "Stardust City Rag")
However, always having "acceptable nutritional value" apparently did not mean that always consuming replicated food necessarily meant one would have a balanced diet no mater what they ate. Kayshon once stated to Brad Boimler, after the later accidentally insulted his weight in the Tamarian language, that it was difficult to lose weight when one could replicate any food they wanted. (LD: "Wej Duj")
Not all replicators carried the same patterns. Jake Sisko was unable to find a replicator on Earth that carried the pattern for I'danian spice pudding as good as that available from the replicators on DS9. Runabout replicators carried particularly sparse menus. (DS9: "The Search, Part I", "In Purgatory's Shadow") The replicators on DS9 needed to be specially programmed with Cardassian food whenever Cardassian dignitaries visited. (DS9: "Destiny", "Ties of Blood and Water") When Geordi La Forge and Worf visited DS9's replimat in 2369, La Forge ordered pasta al fiorella, one of his favorite meals, for both of them. However, while he considered the replimat's version to taste like liquid polymer, Worf called it delicious. (TNG: "Birthright, Part I")
Replicating large numbers of items could require significant amounts of power to be diverted from the warp core. (TNG: "The Child") Complex elements such as anicium and yurium also required large amounts of energy to replicate. (TNG: "Night Terrors") During emergency situations, the use the replicators might be restricted to save power for vital systems or because they were unreliable; requiring rations to be replicated instead of more elaborate food (TNG: "Yesterday's Enterprise"; VOY: "Year of Hell", "The Killing Game", "Demon"; DS9: "The Siege"), rationing of replicator usage (VOY: "The Cloud", "Real Life", "The Void"), or the use of traditionally-prepared food. (DS9: "Covenant"; VOY: "The Cloud") It was sometimes necessary to take the replicators completely offline to conserve power. (DS9: "Covenant"; VOY: "Dark Frontier", "Demon"; PRO: "Terror Firma")
Replicators aboard Starfleet vessels would not produce fatal poisons. (VOY: "Death Wish") Furthermore, replicators had biofilters which automatically screened out all contaminants. (DS9: "Babel") Although clothing could be replicated for general wear, they would not allow non-Starfleet crewmembers to replicate official Starfleet uniforms. (VOY: "Caretaker") They produced synthehol versions of alcoholic drinks by default, but they could easily be manually readjusted through their control panel to make real alcohol instead. (TNG: "Up The Long Ladder")
On Starfleet installations and starships, if a person in custody was confined to quarters, it was standard policy to disable the replicators that the person had access to in order to ensure that a weapon could not be replicated. (DS9: "Inquisition"; VOY: "Counterpoint")
Starfleet replicators made use of the alloy nitrium in their construction. (TNG: "Cost of Living") Components of a replicator included the replicator waveguide, power converter, power supply grid, memory, pattern buffers and the matter-energy conversion matrix. (TNG: "Cost of Living"; DS9: "Defiant", "Heart of Stone", "Visionary", "Our Man Bashir", "Nor the Battle to the Strong") A disruptor pistol had some components in common with a replicator. (DS9: "The Way of the Warrior") Voyager's replicator panels made use of bio-neural gel packs, were enhanced using several alien technologies they had acquired, and had their own secondary power supplies. (VOY: "Macrocosm", "The Void ", "Fair Haven", "Warhead")
History and notable uses
One of the first replicators seen by Humans was the one seen by the crew of Enterprise when they had their ship repaired in a mysterious automated repair station. Prior to this, T'Pol once saw a similar device on a Tarkalean vessel that was capable of replicating almost any inanimate object. Until this time, the most comparable technology aboard 22nd century starships were protein resequencers, which had limited capabilities compared to later technologies. (ENT: "Dead Stop", "Fight or Flight", "Oasis")
In the 23rd century, the United Federation of Planets had not yet perfected replicator technology for ships, though replicators already existed in industrial sites. Replicator technology was, however, in use by The Assigners, and the Beta 5 computer utilized replicator technology to manufacture several false identity cards for use by Gary Seven. (TOS: "Assignment: Earth") Starships of this time period were equipped with food synthesizers and other devices for producing clothing and machine parts on demand. This was a step forward, but did not achieve the quality and sophistication of the 24th century replicator. Replicator technology was not yet employed on starships as late as 2293. (TOS: "The Naked Time", "The Trouble with Tribbles"; VOY: "Flashback"; DIS: "Context Is for Kings", "The Butcher's Knife Cares Not for the Lamb's Cry", "Such Sweet Sorrow, Part 2")
24th century Federation starships were commonly equipped with replicators because they allowed for a wide variety of foods and beverages to be served to crew members and also allowed for replication of other objects. The selection was limited only by the software and the number of options that had been programmed. (TNG: "The Neutral Zone", "The Defector", "Sins of the Father", "All Good Things..."; DS9: "Trials and Tribble-ations"; VOY: "Caretaker", "Phage", "Twisted")
When Beverly Crusher determined that a captured Romulan needed ribosomes to survive, she noted that the replicator could not be used due to the complexity of the molecular structure. (TNG: "The Enemy")
As of 2367, Galaxy-class starships were equipped with a replicating center that contained several replicator terminals resembling miniature transporter pads, at which crew members could order items. Lieutenant Worf and Lieutenant Commander Data shopped the USS Enterprise-D's replicating center for a wedding present for Miles and Keiko O'Brien. (TNG: "Data's Day")
On the Promenade of the Federation space station Deep Space 9, the Replimat provided a casual location for inhabitants to enjoy a meal or beverage courtesy of a bank of replicators located along one of its walls. (DS9: "Emissary")
In 2374, the drink replicator at Quark's experienced a malfunction. To fix it, Quark submitted an emergency maintenance request in the morning, and was assured by Chief Miles O'Brien that Rom would be fixing it right away, however, Rom, in turn, promised Quark that Nog would fix it before the end of the day, however Nog never arrived, but in his place, Jadzia Dax showed up. Quark felt that that task was below her, and fixing a replicator was "work for a mechanic, a repairman, a lowly engineer." Quark later confessed to Odo that, "those hands weren't meant to be poking around inside a filthy drink replicator," as they observed her pulling a green goo from the replicator's insides. (DS9: "Valiant")
Replicators in the Delta Quadrant
"Nothing special. Date with a replicator."
"Cancel it, that's an order."
After the USS Voyager was pulled to the Delta Quadrant in 2371, an energy crisis occurred several weeks into the journey back to the Alpha Quadrant, and Janeway ordered replicator usage to be rationed in order to conserve power for other key systems. These replicator rations became a type of currency among its crew. (VOY: "The Cloud")
Later that year, it became very clear that replicator technology was unknown to the indigenous people of the region around the Ocampan homeworld. The Kazon, in particular, repeatedly tried to obtain this technology, as did other races. Captain Janeway feared that if this technology was acquired by a civilization before it was ready, disastrous consequences could ensue. For this reason, and because of the Prime Directive, Janeway refused to give up this technology at any price. (VOY: "State of Flux") By 2377, however, the crew of Voyager had shared replicators to help people feed and clothe themselves a number of times. (VOY: "Flesh and Blood") In contrast, the Ferengi Arridor and Kol used a portable replicator to pass themselves off as the Holy Sages of the Takarians. (VOY: "False Profits")
In 2374 in the alternate timeline known as the Year of Hell, the replicator system on Voyager was heavily damaged by attacks from Krenim warships, forcing the crew to go to emergency rations. (VOY: "Year of Hell")
In 2378, the young Q manipulated a replicator to tell Janeway "Make it yourself" when she asked it for coffee. (VOY: "Q2") Janeway herself had a tense relationship with her personal replicator. After it burned a pot roast, not the first time it had done so, she told Commander Chakotay that she had once referred to it as a "glorified toaster" and it had never forgiven her. (VOY: "Shattered")
- Fabrication device
- Fundamental field replicator
- Industrial replicator
- Matter-energy conversion matrix
- Matter synthesizer
- Micro-replication system
- Oxygen replication system
- Protein resequencer
- Vehicle replicator
The idea of replicators was unpopular with the writers of The Next Generation and Deep Space Nine. Ira Steven Behr commented: "I'd like to lose the replicators. They're my least favorite thing in Star Trek. A society that uses replicators is a doomed, finished society." (Star Trek: Deep Space Nine Companion (p. ?)) Ronald D. Moore added that "Replicators are the worst thing ever. Destroys storytelling all the time. They mean there's no value to anything. Nothing has value in the universe if you can just replicate everything, so all that goes away. Nothing is unique; if you break something, you can just make another one. If something breaks on the ship, it's "Oh, no big deal, Geordi can just go down to engineering and make another doozywhatsit." Or they go to a planet and that planet needed something: "Oh, hey, let's make them what they need!" We just hated it and tried to forget about it as much as possible." 
Per an odd after-credits scene in the Star Trek: Short Treks episode "The Trouble with Edward", 23rd century food synthesizers apparently incorporated replicator safety protocols, although it remains unconfirmed that replicators incorporated these as well.
Replicators are considered as Star Trek predicting technology, like 3D printing, in part.
The idea that replicators used fecal material was initially mentioned in the Star Trek: The Next Generation Technical Manual, where it stated that replicators on the Enterprise-D extensively sterilized and deconstructed fecal material prior to recombining its component atoms into foodstuffs.