The complex refractive index (dielectric function) of planar CH3NH3PbI3 thin films at room temperature is investigated by variable angle spectroscopic ellipsometry and spectrophotometry. Knowledge of the complex refractive index is essential for designing photonic devices based on CH3NH3PbI3 thin films such as solar cells, light-emitting diodes, or lasers. Because the directly measured quantities (reflectance, transmittance, and ellipsometric spectra) are inherently affected by multiple reflections, the complex refractive index has to be determined indirectly by fitting a model dielectric function to the experimental spectra. We model the dielectric function according to the Forouhi-Bloomer formulation with oscillators positioned at 1.597, 2.418, and 3.392 eV and achieve excellent agreement with the experimental spectra. Our results agree well with previously reported data of the absorption coefficient and are consistent with Kramers-Kronig transformations. The real part of the refractive index assumes a value of 2.611 at 633 nm, implying that CH3NH3PbI3-based solar cells are ideally suited for the top cell in monolithic silicon-based tandem solar cells.