This paper shows how we derived a basic fifth-order geometrical aberration formula for combined electrostatic-magnetic focusing-deflection systems with superimposed fields for electron beam lithography equipment. The formula takes into account relativistic effects and includes four-fold aberration. It enables us to evaluate the system tolerance. The aberration coefficients are classified according to the half angle of the aperture, α, the size of the image, β, the magnetic deflection distance, γm, and the electrostatic deflection distance, γe, defined in the image plane. The number of fifth-order geometrical aberration coefficient formulas derived by this classification process is 380. We used an algebraic language to formulate equations for the coefficients and incorporated them into a program capable of analyzing fifth-order geometrical aberrations. This approach permits the analysis of two-stage deflectors (e.g., a major one using magnetic deflection and a minor one using electrostatic deflection). We then used this tool to analyze specific focusing-deflection systems. The results show good agreement with the experimental results. So, this tool promises to be highly effective in the analysis of fifth-order aberrations for systems which have a large deflection or an apertune with a large half angle.