J.K. Rowling was living in Edinburgh while writing much of Harry Potter.
After returning to the United Kingdom from Portugal, Rowling moved to Edinburgh, Scotland, with her daughter. She wrote in cafés and at home while developing the early Harry Potter manuscripts. The city is therefore closely associated with the period in which the series grew from an unpublished idea into a major publishing project.
Edinburgh is sometimes confused with Rowling’s birthplace near Bristol, her university city of Exeter, or the fictional location of Hogwarts. Hogwarts is not in Edinburgh; the school is an invented setting in the Scottish Highlands within the story.
Edinburgh’s literary reputation and architecture have also encouraged connections with the books, but Rowling has said that Harry Potter was not simply a portrait of one city. The novels combine invented places with influences from many parts of Britain and her own experiences.