We present a general procedure for quantitative structural refinement of superlattice structures. To analyze a wide range of superlattices, we have derived a general kinematical diffraction formula that includes random, continuous and discrete fluctuations from the average structure. By implementing a non-linear fitting algorithm to fit the entire x-ray diffraction profile, refined parameters that describe the average superlattice structure, and deviations from this average are obtained. The structural refinement procedure is applied to a crystalline/crystalline Mo/Ni superlattices and crystalline/amorphous Pb/Ge superlattices. Roughness introduced artificially during growth in Mo/Ni superlattices is shown to be accurately reproduced by the refinement.