Polar phase transitions of fresnoites, Ba2TiSi2O8 (BTS) and Sr2TiSi2O8 (STS) have been comparatively analyzed by the first principles calculations. We show that both BTS and STS have a polar structure with the space group P4bm as a ground state, and there is a fictitious phase transition in the tetragonal space group from the nonpolar P4/mbm meta-stable phase to the polar P4bm phase. From the analyses of the two atomic structures, we find that a noticeable issue in the phase transition is bond length changes of Si–O and Ti–O which break the inversion symmetry, resulting that one of vertices in the edge-shared Si–O and Ti–O polyhedron is detached in the polar phase. The structural phase transition between the polar and the nonpolar states are discussed in terms of electronic structures and structural symmetry mode analyses. We evaluate the size of spontaneous polarizations of BTS and STS in the polar P4bm phases, and the correlation analysis shows significant contributions of the detached polyhedrons to the strong polar property. We also show second harmonic generation susceptibilities of BTS and STS as a candidate for second-order nonlinear optics materials. Our quantitative studies can provide full understandings of atomic and electronic mechanisms of their polar phase and nonlinear optical properties.