It may seem at first that the old saying 'write what you know' cannot be applied to fantasy literature featuring witches and wizards - but a quick stroll around Edinburgh's Old Town reveals a number of key sights which may have influenced JK Rowling.
Here are five locations in Edinburgh that every Harry Potter fan should visit, introduced by expert guides from The Potter Trail.
1. William McGonagall's grave in Greyfriars Kirkyard
A quick stroll through the famous Greyfriars Kirk reveals a number of key sites which may have inspired JK Rowling's Wizarding word.
Tucked away at the back of the cemetery is a small headstone signifying the grave of William McGonagall, a Scottish poet and 'tragedian' who passed away in 1902.
During his life he wrote around 200 poems, including "The Tay Bridge Disaster" and "The Famous Tay Whale", which are widely regarded as some of the worst in English literature.
Fans of the books and films will recognise that Rowling used this surname for a fan-favourite character: Professor Minerva McGonagall, Harry's Transfiguration teacher and the head of Gryffindor House.
2. The real Tom Riddell
Another gravestone worth visiting whilst wandering around Greyfriars Kirk belongs to none other than He-Who-Should-Not-Be-Named.
Not much is known about the real-life Tom Riddell, but it can be gleamed that Rowling used the name as inspiration for one of the series' most sinister characters.
It is revealed within the pages of Harry Potter and the Chamber of Secrets that Tom Riddle is the former name of Harry's arch nemesis Lord Voldermort.
3. The inspiration for Hogwarts
Edinburgh has a number of private schools which can boast about inspiring Hogwarts, the Wizarding school that Harry attends. But it's George Herriot's which actually bears the closest resemblance, both inside and out.
Build in the year 1628, the building features features a striking resemblance to the way Rowling describes Hogwarts in the books, with four large turrets on each of the building's corners.
George Herriot's has four houses which correspond in colour to the Hogwarts houses. The only difference is George Herriot's don't use a Sorting Hat to decide who joins which house.
4. Spoon Cafe on Nicolson Street
Edinburgh's Elephant House could be in the running for most-photographed locations in Edinburgh, with hundreds of tourists snapping a picture of its signage reading "The Birthplace of Harry Potter".
However, the cafe's claim to being the 'birthplace' of the books is actually up for dispute. The Elephant Cafe opened its doors in 1995, the year Rowling is said to have finished penning the novel.
It is believed that JK Rowling actually wrote Harry Potter and the Philosopher's Stone in the Nicholson Cafe, now known as the Spoon Cafe.
5. Victoria Street via Diagon Alley
For Potterheads old and new, Diagon Alley is one of the book's most memorable locations. It's the street where Harry first experiences the Wizarding World - purchasing his first wand and his trusty owl Hedwig.
The inspiration for the shopping district can actually be found right in the centre of the capital. The similarities between the winding Victoria Street and Diagon Alley extend beyond the cobbled street.
At the top of Victoria Street you'll find the headquarters of the Bank of Scotland, a clear parallel to Gringots, the Wizarding bank.
Watch the video above to learn more.
Video by Mark Wilson