The 45-year-old has been in charge at Wycombe since 2012, making him the country’s second-longest serving manager behind Morecambe boss Jim Bentley.
Ainsworth penned a five-and-a-half year deal in December 2014 but has been rewarded with a contract extension after guiding the Chairboys to promotion to League One last season.
“Everything about the club is moulded into the culture of hard work, humility, team spirit and ambition that he has instilled into his players and he is absolutely the right man to continue to take the club forward on the pitch.”
Ainsworth added: “Every day I am proud to be manager of this club and I will always give everything I’ve got to improve myself as a manager and to take the club as far forward as we can.
“We know who we are, we know we’ll always be competing against bigger clubs with more money and more resources, but we’ve got something special here that gives you that buzz to want to see how far it can take us.”