The invention discloses an all-fiber pulsed laser, and belongs to the field of laser technology and nonlinear optics. The all-fiber pulsed laser includes a pump source (1), an optical combiner (2), a first gain fiber (3), a second gain fiber (4), a first reflective fiber Bragg grating (5), a second reflective fiber Bragg grating (6), an optical isolator (7), a full reflection mirror (8) and a circulator (9), and adopts a structure of linear cavity or annular cavity. By use of the rare earth-doped gain fibers as a laser modulator, with no additional external modulation source and an all-fiber structure, ultrashort pulse laser output of high stability, high power, high energy and high efficiency is achieved. Compared with a semiconductor saturable absorption mirror (SESAM) and graphene (Graphene) modulation Q, mode-locking technology, the all-fiber pulsed laser employs gain fiber for direct pulse modulation, has the advantages of simple design, compact structure and high stability, and is easier to industrialize.