The invention discloses a handheld printer, and relates to the technical field of printers. The handheld printer comprises a machine shell, an ink box, a main roller, a main control board and an FPC device, wherein the FPC device comprises a flexible circuit board; the main control board and the flexible circuit board are both arranged in the machine shell, the ink box can be placed inside the machine shell, the flexible circuit board is electrically connected with the main control board, and the flexible circuit board can be electrically connected with the ink box; a printing driving module,a position sensor module and an ink box recognition module are integrated on the flexible circuit board; and the main roller is connected with the machine shell, the main roller is connected with a magnet, and the magnet is opposite to a Hall element inside the position sensor module. According to the handheld printer, the printing driving module, the position sensor module and the ink box recognition module are integrated on one flexible circuit board, so that the space utilization rate is improved, the wiring number can be reduced, the assembly complexity is reduced, and the production efficiency is improved.