High-resolution structures of the glucosidase inhibitors deoxynojirimycin (dNM) and castanospermine (CAST) have been determined by X-ray diffraction. The crystal parameters are a = 10.751(3) and 8.788(3) A, b = 9.263(3) and 8.172(3) A, c = 7.719(2) and 6.507(2) A, and space group P2(1)2(1)2(1) and P2(1) for dNM and CAST, respectively. (beta = 105.44(8) degrees for CAST.) The absolute configuration of CAST has also been established. Stereochemical comparisons with natural glucosidase substrates such as maltose and methyl glucoside show great similarities in the positioning of functional groups, and indicate the basis for enzyme inhibition. Conformational comparison between dNM and CAST suggests the greater activity of CAST may be due to the fixed axial positioning of the O6 atom; the results have implications for the design of analogues for potential anti-HIV and other antiviral therapies.