The invention discloses a lignin carbon nanofiber and a preparation method thereof, belonging to the field of materials. The preparation method comprises 5 steps of lignin pretreatment, preparation of spinning solution, electrostatic spinning, pre-oxidation and carbonization. The preparation method is characterized in that the lignin pretreatment means that lignin with the relative molecular mass within 5,000 to 50,000 is selected, and then the treatment of removing carbohydrate and inorganic salt is respectively carried out on alkali lignin and acetic acid lignin (or formic acid lignin). The diameter of the obtained carbon nanofiber is within 50 to 300nm and the length is within 1 to 10mum. As the obtained lignin has good spinnability, the nanofiber can be spun and further processed into the carbon nanofiber without synthetic macromolecules. In addition, the method adopts simple electrospinning equipment for electrospinning, the diameter of a spinning nozzle is large, the blockage cannot easily occur, and the working reliability of the spinning equipment is ensured.