The structural transition of BaF2 nanocrystals is studied by in situ high pressure synchrotron radiation X-ray diffraction measurements up to about 21.2 GPa at ambient temperature. Two phase transformations were observed at 5.8 and 14.4 GPa, and the two high pressure phases are identified as orthorhombic (Pnma) phase and hexagonal (P6(3)/mmc) phase by Rietveld refinement. Upon decompression, the alpha-PbCl2-type metastable phase is retained when the pressure is released. Two phase transformations of the BaF2 nanocrystals are higher than that in bulk BaF2. It is proposed that the size effects are found to influence the BaF2 nanocrystals high-pressure behaviors and the surface energy plays a significant role in the structural stability.