A swinging LED lamp with a wireless charging function comprises a fixing portion and a magnetic suspension portion, wherein the fixing portion comprises a base and a lug boss formed at an upper end of the base; a main control circuit board and a power source end are arranged in the base; an electromagnet and a transmitting coil are arranged in the lug boss; the electromagnet and the transmitting coil are electrically connected with the power source end through the main control circuit board respectively.