Polyethylene glycol (PEG) modified Na2Ti6O13(m = gram of PEG in the precursor) samples are synthesized via a sol–gel method to determine the effects of PEG on the porosity and activity of Na2Ti6O13. PEG prohibited the growth of Na2Ti6O13 crystals in a rhombic system. The Na2Ti6O13(m) samples prepared using PEG are quite porous without large and dense particles. PEG obviously increased the porosity in Na2Ti6O13(m), while the specific surface area increased from 4.3 m2 g−1 (Na2Ti6O13) to 15.7 m2 g−1 (Na2Ti6O13(1.5)), and the pore volume increased from 0.0072 to 0.0265 cm3 g−1 at the same time. The bandgap energies of Na2Ti6O13, Na2Ti6O13(0.5), Na2Ti6O13(1.5) and Na2Ti6O13(2.5) are 3.15, 3.31, 3.53, and 3.58 eV, respectively. The photoluminescence intensities of the Na2Ti6O13(m) samples are in the reducing sequence: Na2Ti6O13, Na2Ti6O13(2.5), Na2Ti6O13(0.5) and Na2Ti6O13(1.5). The initial ofloxacin molecules in the solution are almost fully degraded after 70 min of irradiation using Na2Ti6O13(1.5), while the degradation efficiency of Na2Ti6O13 is only 61.0% at the same time.