When a gas is ionized by a few-cycle laser pulse, some residual current density (RCD) of free electrons remains in the produced plasma after the passage of the laser pulse. This quasi-dc RCD is an initial impetus to plasma polarization and excitation of the plasma oscillations which can radiate terahertz (THz) waves. In this work, the analytical model for calculation of RCD excited by a fewcycle laser pulse is developed for the first time. The dependences of the RCD on the carrierenvelope phase (CEP), wavelength, duration, and intensity of the laser pulse are derived. It is shown that maximum RCD corresponding to optimal CEP increases with the laser pulse wavelength, which indicates the prospects of using mid-infrared few-cycle laser pulses in the schemes of generation of high-power THz pulses. Analytical formulas for optimal pulse intensity and maximum efficiency of excitation of the RCD are obtained. Basing on numerical solution of the 3D time-dependent Schr€ odinger equation for hydrogen atoms, RCD dependence on CEP is calculated in a wide range of wavelengths. High accuracy of analytical formulas is demonstrated at the laser pulse parameters which correspond to the tunneling regime of ionization. V C 2015 AIP Publishing LLC. [http://dx.