McGinn signed a two-year deal when he arrived at Pittodrie from Celtic last summer and earned an extended deal by notching 21 goals ahead of Aberdeen's final Clydesdale Bank Premier League game of the season against Hearts.
Manager Derek McInnes told the club's official website: "As far as I am concerned Niall is going to be the big summer signing for Aberdeen FC and hopefully this sends out the correct signal to not only our supporters but also to any other players who are potentially thinking about signing for this great club."
McGinn, 25, added: "It really was an easy decision for me to sign this extension.
"I'm enjoying my time at the club, the players, the management team and the staff throughout the club have made the last season a pleasure for me so I was more than happy to commit my future to the Dons.
"I would also like to thank the supporters who have welcomed me to the city and given not only me but the team fantastic backing this season.
"I didn't come here just to play out the time on my contract, I am here to help bring back some silverware to the club and I hope next season we can strive to deliver that for the supporters."