Low-temperature molten-salt method and the NH4NO3 flux were developed to synthesize quasi-spherical cubic BaGdF5:Ce3+/Er3+/Yb3+ nanocrystals with the average diameter of 30 nm. The optimum doping concentrations of Er3+ and Yb3+ are determined to 2 and 20 mol%, respectively. The introduction of Ce3+ in BaGdF5: Er3+/Yb3+ nanocrystals deduced a huge variation of the profile of the UC emission under 976 nm laser irradiation. The strong ultraviolet UC emission of 330–380 nm is due to the overlap of 4G7/2,2K15/2,4G9/2 → 4I15/2 transitions of Er3+, and strong blue one locating at 440–480 nm is attributed to the overlap of 4F3/2,4F5/2 → 4I15/2 and 4G7/2,2K15/2,4G9/2 → 4I13/2 transitions of Er3+, respectively. The UC emission mechanism and energy transfer process of BaGdF5:Ce3+/Er3+/Yb3+ nanocrystals were provided in detail and demonstrated by the fluorescence decay curves and pumping power dependent UC emission spectra. This work not only demonstrates a rational approach to tailor UC emission (red, blue and ultraviolet) by tuning doping ions and concentration, but also for better understanding of their essential UC luminescence properties.