McGinn made 28 appearances for Celtic, scoring four goals, before being sent out on loan last season to Brentford City where he scored five goals in 37 appearances.
The Northern Irishman, who can play on the left or right wing or as a secondary striker, has 18 caps for his country.
McGinn told RedWeb: "Aberdeen is a massive club and I'm really looking forward to be back playing in Scotland.
"I thoroughly enjoyed my time at Brentford last season and, playing week in week out has, I believe, made me a better player.
"Craig Brown has big plans for the club and I definitely want to be a part of that."
AFC have made the 24-year-old their second signing of the summer.
McGinn joins former Inverness Caley Thistle winger Jonny Hayes through the door as the Dons look to strengthen against a backdrop of uncertainty in the Scottish top league.