J.K. Rowling wrote parts of the early Harry Potter books in Edinburgh.
Rowling moved to Edinburgh in 1993 and lived there while raising her daughter Jessica. She worked on the manuscripts in cafés and at home, especially during the years before the first Harry Potter book was published. Edinburgh later became an important location in public accounts of her writing career.
The city is in Scotland, but it is not the same place as Hogwarts. Hogwarts is a fictional school whose exact location is protected by magic within the novels. Edinburgh’s streets, architecture, and literary history helped shape the atmosphere surrounding Rowling’s writing, but the school is not identified as a real Edinburgh institution.
Visitors often connect the city with the series through literary tours and landmarks associated with Rowling. Those associations concern the author’s life and working locations rather than a literal map of the wizarding world.