Electron-beam (e-beam) lithography is widely employed in fabrication of 2-D patterns and 3-D structures. A certain type or shape of the sidewall in the remaining resist profile may be desired in an application, e.g., an undercut for lift-off and a vertical sidewall for etching, or required for a device. Also, as the feature size is decreased well below a micron, a small variation of the sidewall slope can lead to a significant (relative) CD error in certain layers of resist. Therefore, it is important to understand effects of spatial dose distribution on sidewall shape and be able to achieve the desired shape. In this study, via simulation, the relationship among the total dose, spatial distribution of dose, developing time and sidewall shape, and performance of the method developed to optimize the dose distribution for a target sidewall shape have been analyzed. The simulation results have been verified through experiments.