The characterization of sub-micron gratings is usually performed on scanning electron microscopes, although the dimensions of the features often make the observations difficult. We report here on a new method applicable to III-V and II-VI semiconductors: we use transmission electron microscopy on wedge-shaped samples oriented along a [111] zone axis. Grating parameters can be obtained with a precision of 1 nm, along with information on the shape and the regularity of the ridge profile, the surface quality as well as the local chemical composition.