Photonic crystals possess metastructures with a unique dispersion relation. An integrated optical circuit plays a crucial role in quantum computing, for which miniaturized optical components can be designed according to the characteristics of photonic crystals. Because the stable light transmission mode for a square waveguide is transverse electric or transverse magnetic polarization, we designed a half-waveplate element with a photonic crystal that can rotate the polarization direction of the light incident on a waveguide by 90°. Using the dispersion relation of photonic crystals, the polarization rotation length and the optical axis’s angle of deviation from the electric field in the eigenmode can be effectively calculated. Polarization rotators designed on the basis of photonic crystal structures can effectively reduce the insertion loss of components and exhibit favorable polarization rotation performance.