My fiance just asked me if replicators got their matter by dereplicating human waste, and I realized I wasn't sure. Even after researching the matter, I can't find any concrete information. So where does the matter come from? Is it from recycled human waste, or is there some sort of energy-matter conversion involved?
Assuming you're referring to TNG (onwards), Federation starships carry a feedstock of raw materials that can be easily converted into the widest possible range of substances by the replicator systems. Before this, starships (like the Enterprise NX-1 and Enerprise NCC-1701) used reclamation systems to process waste water back into potable water. There's no indication that any of the ships we see processed solid human waste back into food.
Per the TNG Technical Manual
In order to minimize replicator power requirements, raw stock for food replicators is stored in the form of a sterilized organic particulate suspension that has been formulated to statistically require the least quantum manipulation to replicate most finished foodstuffs
Material that cannot be directly recycled by mechanical or chemical means is stored for matter synthesis recycling. This is accomplished by molecular matrix replicators that actually dematerialize the waste materials and rematerialize them in the form of desired objects or materials stored in computer memory. While this process provides an enormous variety of useful items, it is very energy intensive and many everyday consumables (such as water and clothing) are recycled by less energy intensive mechanical or chemical means. Certain types of consumables (such as foodstuffs) are routinely recycled using matter replication because this results in a considerable savings of stored raw material
You can tell your fiance that human waste materials are generally stored and offloaded at Starbase (e.g. rather than being recycled) although such a thing is possible and almost certainly happens on long voyages where regular stops aren't feasible (e.g. Voyager).
For avoidance of doubt
Archer = Definitely drinking his own recycled urine
Kirk = Almost certainly drinking his own recycled urine
Picard = Definitely not drinking his own urine
Sisko = Almost certainly drinking his own recycled urine
Janeway = Almost certainly drinking her own recycled urine