Although previous sci-fi writers had speculated about the development of "replicating" or "duplicating" technology, the term "replicator" was not itself used until Star Trek: The Next Generation. In simple terms, it was described as a 24th century advancement from the 23rd century "food synthesizer" seen in Star Trek: The Original Series. The mechanics of these devices were never clearly explained on that show. The subsequent prequel series, Star Trek: Enterprise, set in the 22nd century, featured a "protein resequencer" that could only "replicate certain foods," so an actual chef served on board who used "a hydroponic greenhouse" where fruits and vegetables were grown. Additionally, that ship had a "bio-matter resequencer" which was used to recycle waste product into usable material.
According to an academic thesis: "The so-called 'replicators' can reconstitute matter and produce everything that is needed out of pure energy, no matter whether food, medicaments, or spare parts are required." A replicator can create any inanimate matter, as long as the desired molecular structure is on file, but it cannot create antimatter, dilithium, latinum, or a living organism of any kind; in the case of living organisms, non-canon works such as the Star Trek: the Next Generation Technical Manual state that, though the replicators use a form of transporter technology, it's at such a low resolution that creating living tissue is a physical impossibility.
In its theory it seems to work similarly to a universal assembler.
A replicator works by rearranging subatomic particles, which are abundant everywhere in the universe, to form molecules and arrange those molecules to form the object. For example, to create a pork chop, the replicator would first form atoms of carbon, hydrogen, nitrogen, etc., then arrange them into amino acids, proteins, and cells, and assemble the particles into the form of a pork chop.
This process requires the destructive conversion of bulk matter into energy and its subsequent reformation into a pre-scanned matter pattern. In principle, this is similar to the transporter, but on a smaller scale. However, unlike transporters, which duplicate matter at the quantum level, replicators must be capable of a large number of different materials on demand. If patterns were to be stored at the quantum level, an impossible amount of data storage (or a set of original copies of the materials) would be required. To resolve this, patterns are stored in memory at the molecular level.
The drawback of doing so is that it is impossible to replicate objects with complicated quantum structures, such as living beings, dilithium, or latinum. In reality, living beings and/or cited elements are not necessarily more complex on a quantum level; the putative 'extra complexity' is used an in-universe function to head off questions such as 'why can't Starfleet replicate people?' In the TNG episode "Allegiance", aliens used their version of replicators to create a Picard impostor. Additionally, read/write errors cause a number of single-bit errors to occur in replicated materials. Though usually undetectable to human senses, computer scanning can be used to reveal these discrepancies, and they may explain the frequent complaint (by some gourmets and connoisseurs) that replicated food and beverages suffer from substandard taste. These errors also may cause a nontoxic material to become toxic when replicated, or create strains of deadly viruses and bacteria from previously harmless ones.
One of the most important pieces of technology in the Star Trek universe, the replicator is used primarily to provide food and water on board starships, thus eliminating the need to stock most provisions. (Starships, starbases, and other installations stock some provisions for emergency use, in case of replicator failure or an energy crisis.) On Star Trek: Deep Space Nine, it was established that as long as there is an energy source to power life support, replication is used to provide breathable air on ships and starbases (and to disassemble the carbon dioxide exhaled by the crew), thus providing a seemingly endless supply of oxygen and eliminating the need to carry air tanks.
The technology is also used for producing spare parts, which makes it possible to repair most ship damage without having to return to a starbase. Other applications include replication of Starfleet uniforms, as well as everyday objects such as toys and souvenirs. Replication is also used by the Holodeck program to allow food, clothes, and other objects belonging within a simulation to be used or consumed by the participants.
Starfleet's safety protocols prevent unauthorized replication of dangerous objects, such as weapons and poisonous substances.
Replicators can also convert matter into energy. Following that principle, the device can dismantle any object into subatomic particles. The ensuing energy can then be stored for future use or immediately applied in a subsequent replication. This process is referred to as "recycling", and is applied to everything from dirty dishes to outgrown children's clothes.
Replicator technology, even if produced on a larger scale, cannot be used to create complex objects such as shuttlecraft or starships (the production staff felt that being able to replicate entire starships "at the push of a button" would severely impact dramatic potential). However, in the Star Trek: Deep Space Nine episode "For the Cause", industrial replicators are used to replicate large components of ships, shuttlecraft, and other pieces of this sort, which are later used in shipyards to construct such vessels. In this manner, as few as 15 industrial replicators are enough to replicate the components needed to build a fleet of starships or to help a civilization recover from a planet-wide natural disaster.
By virtually eliminating material scarcity, replicator technology plays an important role in the moneyless human economy within the Star Trek universe.
When the USS Voyager was pulled to the Delta Quadrant, it became clear that replicator technology was unknown to some of the indigenous peoples of that region. Throughout the first seasons, the Kazon and other races tried repeatedly to obtain the technology.
Captain Janeway feared that if this technology were acquired by a civilization before they were ready, disastrous consequences could ensue. For this reason, and because of the Prime Directive, Janeway refused to give away the technology at any price.
Also on Voyager, the ship's energy constraints on the journey back to the Alpha Quadrant meant that replicator supplies had to be strictly controlled, leading to "replicator rations" becoming an unofficial ship currency. This is also the reason Neelix (aside from providing the crew with a morale boost through the preparation of fresh food) became employed as the ship's chef. Some ingredients came from the ship's hydroponics laboratory.
In 2014, researchers at Nestlé were reported as working on technology comparable to the replicator, with the goal of providing food tailored to an individual's nutritional requirements.
In 2015, a Star Trek-inspired Replicator-Emulator is proposed to robotically grow, print or assemble not only food, but also shelter, energy, transportation and even whole towns. #WPProjects assigned 250 renewable automation projects - one project to every country in the world - and it also laid out the important social programs needed to protect incomes and bolster economies as societies completed their 2-year Renewable Automations projects.
In comparison, 3D printers, which are now a mainstream technology and have a range of impressive and important capabilities (including shaping prostheses or making organs) are decidedly different, in that they do not create material "ex nihilo" (out of nothing), or perhaps more accurately, out of nuclei or atoms or programmed patterns of information, but instead, like regular printers, must use already pre-existing corporal material.
Also, 3D printers are limited in the materials that they can print. Currently only materials that can be easily fused together via extrusion or sintering processes can be used by 3D printer technology — generally plastics, metals, and clays. However food, concrete, and a few other materials have been successfully printed on a limited scale.
Imperial College London physicists have discovered how to create matter from light - a feat thought impossible when the idea was first theorised 80 years ago. In just one day in Imperial's Blackett Physics Laboratory, three physicists worked out a relatively simple way to physically prove a theory first devised by scientists Breit and Wheeler in 1934.