Lead-free ([Formula: see text][Formula: see text])NbO3 (KNN) and [Formula: see text]([Formula: see text][Formula: see text])[Formula: see text]NbO3 (LKNN) thin films were fabricated by a sol-gel method. The effects of Li substitution on crystal structure, microstructure and electrical properties of KNN film were systematically studied. Li doping can enhance the ferroelectric and piezoelectric properties of KNN film. Compared with pure KNN film, the LKNN film possesses larger remanent polarization ([Formula: see text] [Formula: see text] 9.3 [Formula: see text]C/[Formula: see text]) and saturated polarization ([Formula: see text] [Formula: see text] 41.2 [Formula: see text]C/[Formula: see text]) and lower leakage current density ([Formula: see text]A/[Formula: see text] at 200 kV/cm). Meanwhile, a typical butterfly shaped piezoelectric response curve is obtained in the LKNN film with a high piezoelectric coefficient ([Formula: see text] [Formula: see text] 105 pm/V). Excellent fatigue resistance ([Formula: see text][Formula: see text] switching cycles) and aging resistance ([Formula: see text] 180 days) demonstrate the long-term working stability of LKNN film. These findings indicate that KNN-based lead-free piezoelectric films have a broad application prospect in microelectromechanical systems (MEMS).