The nailing gun uses a motor as a power drive to rotate a drive gear wheel and a driven gear wheel, causing the drive gear wheel and the driven gear wheel to alternatively move a slider from a nailing position to a standby position, for enabling a nail driving tip, which is fastened to the slider, to be moved with the slider from the standby position to the ailing position by spring member, which is compressed to preserve energy when the slider moved from the nailing position to the standby position.