In3+ was taken as a new dopant to codope NaYF4 with Er3+ and Yb3+ by hydrothermal synthesis in this manuscript. How to improve phase transition of NaYF4 from cubic to hexagonal and how to improve upconversion luminescence performance of hexagonal NaYF4 are both important problems because hexagonal NaYF4 is the most efficient matrix material for upconversion. Considering these two problems, we report the study of crystal structure and upconversion emission of In3+-codoped NaYF4 to discover phase transition mechanism and upconversion luminescence properties changed with different In3+ codoping concentration. NaY0.92Yb0.03Er0.02F4 was tridoped with 0, 2, 4, 6, 8 and 10 mol% In3+ at 170 ℃ for 8 h in order to study phase transition of NaYF4. The other group of samples was prepared by the same procedure except In3+codoping concentration was replaced as 0, 1, 2, 3, 4 and 5 mol% and the reaction proceeded at 190 ℃ for 12 h in order to obtain pure hexagonal NaYF4 for study of its upconversion luminescence. The change of morphologies and crystal structural transition caused by In3+ codoping was explored by XRD, Rietveld refinement, SEM and TEM analysis methods, while the upconversion luminescence was characterized by emission spectra and luminescence decay curves, for the relationship between crystal microstructure and luminescence properties to be discussed in our investigation. On the basis of these characterizations we found that with rising of the In3+ codoping concentration, the phase transition of NaYF4 from cubic to hexagonal was improved. The intensity of upconversion luminescence was also found to be increased to the maximum when 3 mol% In3+ was codoped into hexagonal NaYF4. The analysis and discussion discovered that the phase transition of NaYF4 was correlated with the lattice distortion of cubic NaYF4 improved by In3+ codoping. The intensity of upconversion luminescence was proved to be increased by the asymmetry of the local crystal field changed with the In3+ codoping concentration. This investigation may be helpful for design and synthesis of other functional materials.