Peering inside cells has been an integral part of biology ever since the 17th century, when cells were discovered under a microscope. But even with advances in light and electron microscopy, researchers who want to understand where various molecules are inside a cell — and thus how cells like neurons, immune cells and tumors differ from one another — can glean only so much.

Now, scientists have come up with a new way to capture what’s going on in there. The approach, called DNA microscopy, uses simple chemical reactions essentially to map a cell’s interior, highlighting the contents and indicating exactly where everything can be found.

The technique, described Thursday in the journal Cell, also reveals a wealth of genetic information not accessible with traditional microscopy tools: which immune receptor genes are turned on or off, say, and whether cells are healthy or full of disease-causing mutations.

“DNA microscopy captures both genetic and spatial information simultaneously,” said Joshua Weinstein, a postdoctoral researcher at the Broad Institute of M.I.T. and Harvard and the lead author of the paper. “That’s what’s really beautiful about it.”