Pattern formation in electron beam lithography (EBL) is investigated with molecular dynamics simulations. The electron exposure and development process are modeled by polymer chain scission and polymer segment removal from the resist, respectively. The line edge roughness of a sub-10-nm resist pattern is analyzed with the simulations. The proximity effect in EBL is also investigated. The effects of resist molecular size, secondary electron generation, and the substrate material are discussed.