A technology that simultaneously records membrane potential from multiple neurons in behaving animals will have a transformative effect on neuroscience research. Genetically encoded voltage indicators are a promising tool for these purposes; however, these have so far been limited to single-cell recordings with a marginal signal-to-noise ratio in vivo. Here we developed improved near-infrared voltage indicators, high-speed microscopes and targeted gene expression schemes that enabled simultaneous in vivo recordings of supra- and subthreshold voltage dynamics in multiple neurons in the hippocampus of behaving mice. The reporters revealed subcellular details of back-propagating action potentials and correlations in subthreshold voltage between multiple cells. In combination with stimulation using optogenetics, the reporters revealed changes in neuronal excitability that were dependent on the behavioural state, reflecting the interplay of excitatory and inhibitory synaptic inputs. These tools open the possibility for detailed explorations of network dynamics in the context of behaviour. Fig. 1 PHOTOACTIVATED QUASAR3 (PAQUASAR3) REPORTS NEURONAL ACTIVITY IN VIVO.: a, Schematic of the paQuasAr3 construct. b, Photoactivation by blue light enhanced voltage signals excited by red light in cultured neurons that expressed paQuasAr3 (representative example of n = 4 cells). c, Model of the photocycle of paQuasAr3. d, Confocal images of sparsely expressed paQuasAr3 in brain slices. Scale bars, 50 μm. Representative images, experiments were repeated in n = 3 mice. e, Simultaneous fluorescence and patch-clamp recordings from a neuron expressing paQuasAr3 in acute brain slice. Top, magnification of boxed regions. Schematic shows brain slice, patch pipette and microscope objective. f, Simultaneous fluorescence and patch-clamp recordings of inhibitory post synaptic potentials in an L2-3 neuron induced by electrical stimulation of L5-6 in acute slice. g, Normalized change in fluorescence (ΔF/F) and SNR of optically recorded post-synaptic potentials (PSPs) as a function of the amplitude of the post-synaptic potentials. The voltage sensitivity was ΔF/F = 40 ± 1.7% per 100 mV. The SNR was 0.93 ± 0.07 per 1 mV in a 1-kHz bandwidth (n = 42 post-synaptic potentials from 5 cells, data are mean ± s.d.). Schematic shows brain slice, patch pipette, field stimulation electrodes and microscope objective. h, Optical measurements of paQuasAr3 fluorescence in the CA1 region of the hippocampus (top) and glomerular layer of the olfactory bulb (bottom) of anaesthetized mice (representative traces from n = 7 CA1 cells and n = 13 olfactory bulb cells, n = 3 mice). Schematics show microscope objective and the imaged brain region. i, STA fluorescence from 88 spikes in a CA1 oriens neuron. j, Frames from the STA video showing the delay in the back-propagating action potential in the dendrites relative to the soma. k, Sub-Nyquist fitting of the action potential delay and width shows electrical compartmentalization in the dendrites. Experiments in k-m were repeated in n = 2 cells from n = 2 mice.