LiNi0.5Mn1.5O4, which has a spinel framework structure, is a promising candidate for the cathode material of next-generation lithium-ion batteries with high energy density. We investigate the structural transition in Li x Ni0.5Mn1.5O4 (0 ≤ x ≤ 1) through first-principles calculations using the projector augmented wave method with the generalized gradient approximation. We calculate all the unique Li-site occupation configurations in a unit cell to obtain the total energies and the most stable structures for various compositions. Thermodynamic analysis shows that Li0.5Ni0.5Mn1.5O4 with x = 0.5 is the only stable phase for 0 < x < 1. The decomposition energy is lower than 0.1 eV for 0 < x < 0.5, but is distinctly higher for 0.5 < x < 1. The decomposition energy reaches 0.39 eV at x = 0.75. The ratios of the structures at room temperature are calculated from Boltzmann factors by using the energy differences between structures. The crystal structure of the unit cell changes gradually from x = 0 to 0.5, but changes markedly from x = 0.5 to 1. This first-principles study provides a general evaluation of the variation in the crystal structure with the composition of the bulk material, which affects the cyclability of the electrode.