Intracellular recordings of neuronal membrane potential are a central tool in neurophysiology. In many situations, especially in vivo, the traditional limitation of such recordings is the high electrode resistance and capacitance, which may cause significant measurement errors during current injection. We introduce a computer-aided technique, Active Electrode Compensation (AEC), based on a digital model of the electrode interfaced in real time with the electrophysiological setup. The characteristics of this model are first estimated using white noise current injection. The electrode and membrane contribution are digitally separated, and the recording is then made by online subtraction of the electrode contribution. Tests performed in vitro and in vivo demonstrate that AEC enables high-frequency recordings in demanding conditions, such as injection of conductance noise in dynamic-clamp mode, not feasible with a single high-resistance electrode until now. AEC should be particularly useful to characterize fast neuronal phenomena intracellularly in vivo.