SHELL2: package for the calculation of two loop on-shell Feynman diagrams in FORM. The description of a program written in FORM for the analytic calculation of propagator-type one- and two-loop Feynman graphs with external lines corresponding to massive as well as massless particles on-shell is presented. Dimensional regularization to regularize both ultraviolet and infrared divergences is used. The program calculates the contributions from any such diagram for an arbitrary value of the space-time dimension n in terms of one “master integral” and two simple integrals expressable in terms of Euler’s Γ function. The package can be used for the calculation of anomalous magnetic moments of fermions, renormalization constants in the on-shell renormalization scheme, the effective field theory of static quarks and other problems. As an example of an application the two-loop coefficient for the anomalous magnetic moment of the electron in QED is reproduced in the framework of dimensional regularization.