J.K. Rowling wrote part of Harry Potter and the Philosopher’s Stone in Edinburgh.
After moving to Scotland, Rowling worked on the first Harry Potter novel while living in Edinburgh. She is especially associated with writing in cafés there, including venues often linked with the book’s early composition. Edinburgh’s old streets and historic architecture later became part of the public image surrounding her writing career.
The novel itself is not set in Edinburgh. Hogwarts and most major locations belong to the fictional wizarding world, while the early chapters use real places in and around Surrey and London before Harry enters the magical community.
Readers sometimes assume that every memorable location connected with Rowling’s biography appears directly in the books. Edinburgh was important as a place where she wrote, but it is not the real-world location of Hogwarts, which Rowling has never identified as an actual building.