Lego Harry Potter: Years 5–7 is a -themed developed by and published by . Released on 11 November 2011 in North America and November 18 in Europe, the game is based on the toy line and is based on the final three books and four films in the : , , , and . The game was released for the , , , , , , , , and . The first of three trailers was released 6 October 2011, and the demo was released on 1 November.
The game was released on on 5 January 2012. The OS X version of the game was released by on 7 March 2012. The game was released for the on 21 October 2016, as part of the Lego Harry Potter Collection, which bundles the game with its predecessor, , and was also released for the and on 30 October 2018.
The game received generally positive reviews, especially to the humour added to the game's narrative.
Lego Harry Potter: Years 5–7's basis gameplay follows the standards of that of as adapted to the story of the last three and four , covering a wide range of new characters, locations and items. The online play feature that appeared in Lego Harry Potter Years 1–4 is absent from the PS3 and Xbox 360 versions of this game. Some additional quality of life changes were made, such as Wingardium Leviosa (for building and moving certain objects) no longer needing the spell to be selected to do said features.
The DS and PSP versions of the game are quite a bit scaled back, with a smaller hub, less collectibles. as well as worse graphics, but they still follow the storyline of Harry Potter.