A nanofactory is a proposed system in which nanomachines (resembling molecular assemblers, or industrial robot arms) combine reactive molecules via mechanosynthesis to build larger atomically precise parts. These, in turn, are assembled by positioning mechanisms of assorted sizes to build macroscopic (visible) but still atomically-precise products.

A typical nanofactory would fit in a desktop box, in the vision of K. Eric Drexler published in Nanosystems: Molecular Machinery, Manufacturing and Computation (1992), a notable work of exploratory engineering. It is highly contestable whether this vision is feasible. Some works of science fiction have also explored this and similar concepts.

The potential for such devices is part of the mandate of a major UK study led by mechanical engineering professor Ann Dowling. This is expected to report sometime in 2004.