Nanosecond passive Q-switching generation from an all-fiber erbium-doped laser with a UV inscribed 45° tilted fiber grating (TFG) is systematically demonstrated. The 45° TFG is employed as a polarizer together with two polarization controllers (PCs) to realize nonlinear polarization rotation (NPR). Because of the NPR effect, stable Q-switched pulses with an average output power of 17.5 mW, a single pulse energy of 72.7 nJ, a repetition rate of 241 kHz, a pulse width of 466 ns, and a signal to noise ratio (SNR) of 58.8 dB are obtained with 600 mW pump power. To the best of our knowledge, the SNR is the highest among all-fiber passively Q-switched erbium-doped laser. The stability of this erbium-doped fiber laser (EDFL) is also examined by monitoring the laser consecutively for 5 h under laboratory conditions.