This paper describes a pattern inspection technique for X-ray masks that uses a scanning transmission electron microscope (STEM). The conventional scanning electron microscopes (SEM) do not give pattern images of desired quality because a protective coating on the mask accumulates charge when subjected to an electron beam. This problem was solved by using a STEM; the high acceleration voltage enabling the STEM to detect stable mask patterns despite the charging effect. For practical use, however, the low SN ratio and low detection speed must be improved. To do this, the electron trajectories in X-ray masks were examined by Monte Carlo simulations, and the existence of the best detecting angle which maximizes contrast was found. A high SN ratio and high detection speed have been achieved by properly designing the STEM, employing an exit stop arrangement to realize the best detecting angle. This system is expected to show performance of a minimum detectable size of 0.1μm and inspection speed of 1cm2/hour.