We present a digital method for holographic microscopy involving a CCD camera as a recording device. Off-axis holograms recorded with a magnified image of microscopic objects are numerically reconstructed in amplitude and phase by calculation of scalar diffraction in the Fresnel approximation. For phase-contrast imaging the reconstruction method involves the computation of a digital replica of the reference wave. A digital method for the correction of the phase aberrations is presented. We present a detailed description of the reconstruction procedure and show that the transverse resolution is equal to the diffraction limit of the imaging system.