An elegant mathematical technique has been developed and tested for computing the shapes of nanocrystals from X-ray diffraction (XRD) data. The method is specially suited to the shape analysis of crystallites in nanopowder specimens. Unlike visualization techniques such as transmission electron microscopy (TEM), it can find the full 3-D crystallite shape even in the presence of agglomeration. The technique has been validated using XRD and TEM data on the systems CeO2, Ge, ZnO, Zr56C44, In2O3, MnFe2O4, and iron(II-III) hydroxysulfate. This will aid in the shape-selective synthesis and design of materials. Other merits of the method and some extensions are also discussed.