Electron microscopy (EM) is the standard method for imaging cellular structures with nanometer resolution, but existing genetic tags are inactive in most cellular compartments or require light and can be difficult to use. Here we report the development of 'APEX', a genetically encodable EM tag that is active in all cellular compartments and does not require light. APEX is a monomeric 28-kDa peroxidase that withstands strong EM fixation to give excellent ultrastructural preservation. We demonstrate the utility of APEX for high-resolution EM imaging of a variety of mammalian organelles and specific proteins using a simple and robust labeling procedure. We also fused APEX to the N or C terminus of the mitochondrial calcium uniporter (MCU), a recently identified channel whose topology is disputed. These fusions give EM contrast exclusively in the mitochondrial matrix, suggesting that both the N and C termini of MCU face the matrix. Because APEX staining is not dependent on light activation, APEX should make EM imaging of any cellular protein straightforward, regardless of the size or thickness of the specimen.