Pyrite is an attractive material as its good photovoltaic performance; however, the presence of marcasite phase is considered to be detrimental to pyrite as a photovoltaic material due to its low band gap. Density functional theory (DFT) combined with Hubbard U correction was used to perform the calculations on the crystal structures, electronic structures, and optical properties of pyrite and marcasite in the present work. When a U value of 1.5 eV is adopted to Fe 3d, the band gaps of pyrite and marcasite are calculated to be 1.05 eV and 1.33 eV, respectively, compared to 0.54 eV and 1.05 eV without adopting U. It is found that the fundamental band gap in pyrite is formed by Fe 3d-S 3p transition while in marcasite it is formed by Fe 3d-Fe 3d transition. The larger band gap of marcasite suggests that the presence of marcasite could not deteriorate the photovoltaic performance of pyrite. The subsequent calculations on the optical properties confirmed a very similar optical absorption performance of marcasite to pyrite, even finding a redshift of the optical absorption edge of marcasite compared to pyrite in the low energy region and a wider absorption range in the high energy region. These results were associated with the Fe octahedron differences in the crystals, which resulted in a different d orbital splitting scheme proposed in our study.