The core–shell nanofibers, which contain titanium oxide (TiO2) and tin oxide (SnO2), are known as electrospun nanofibers that improve the performance of dye-sensitized solar cells by exploring the photoanode. The morphology and microstructure of the electrospun nanofibers are studied by scanning electron microscopy (SEM), transmission electron microscopy (TEM), and X–ray diffraction (XRD). Based on the SEM micrographs the fibers have a bilayer TiO2–SnO2 core–shell structure with a 70–120 nm diameter. The XRD analysis shows the dominant crystalline phase of the synthesized nanostructures after heat treatment. Finally, the synthesized nanofibers are used to prepare dye-sensitized solar cell photoanodes with thicknesses of 8, 11, 14, and 17 μm, which their performances are investigated. The current–voltage (I–V) curve of the solar cells under the Xenon lamp irradiation is measured and calculated. The optimal solar cell with a photoanode made electrophoretic at 30 V for 8 min shows the best performance. The optimal thickness of the TiO2–SnO2 nanocomposite for this photoanode is 14 μm. The short-circuit current density, open-circuit voltage, and optimal cell efficiency for this sample are 19.35 mA/cm2, 650 mV, and 9.27%, respectively.