A molecular scale simulation of the pattern formation process in electron beam lithography based on the stochastic approach is proposed. The formation of the initial resists structure is achieved by sequentially joining randomly selected monomers. The effects of electron exposure for positive-type resists are introduced by scission of the polymer chain. The effects of electron exposure for negative-type resists are introduced by crosslinkings among the polymer chains. The fundamental properties, such as sensitivity curves, molecular weight dependence, and exposure condition effects on pattern profiles, are well reproduced by the simulation. The simulation results are shown to be appropriate when compared with the properties reported from the experiment.