The invention is directed to compounds for selectively inhibiting glycosidases, uses of the compounds and pharmaceutical compositions including the compounds, and methods of treating diseases and disorders related to deficiency or overexpression of O-GlcNAcase, and/or accumulation or deficiency of O-GlcNAc.