To Harry Potter fans, the rare books room at the New York Academy of Medicine may feel familiar. Musty leather-bound books line the walls behind screens; moldings of griffins adorn the plaster ceiling; a cat skeleton with arched vertebrae crouches on a bookshelf. Stepping inside the room feels like you’ve apparated to Hogwarts.

Anne Garner, the curator of rare books and manuscripts at the academy, is well aware of the similarities. But she didn’t realize just how deep they ran until stumbling upon a card catalogue labeled "witchcraft" in the archives. "When I saw the card catalogue, the connection with people saying this room feels like Hogwarts sort of clicked," she said at a press event.

Ulisse's Aldrovandi's Phoenix from the 1664 book "Monstrorum Historia" The New York Academy of Medicine

That was the impetus behind the library's new digital collection, "How to Pass Your O.W.L at Hogwarts: A Prep Course," which highlights real texts from the rare books room and matches them to fictional courses taught at Hogwarts. While much of J.K. Rowling's world is her own invention, many of the creatures, objects, and even people she writes about are lifted from European history and mythology. Garner searched for these real-life inspirations when selecting books to feature in the virtual library.

The "Potions" section, for example, includes a description of a bezoar, the same ruminal hairball that Harry feeds to a poisoned Ron in The Half Blood Prince. One book under "Transfiguration" mentions Nicolas Flamel, the actual figure who’s credited with creating the philosopher's stone in the first Harry Potter book.

Star thistle from Nicholas Culpeper's 17th-century book "English Physician" The New York Academy of Medicine

The digital collection is filled with vibrant illustrations dating back to the 15th century. Books in "Care of Magical Creatures" depict basilisks and unicorns alongside snakes and narwhals (or “unicorns of the sea,” as they were known centuries ago). "One of the things I love about Harry Potter is that it presents us with this world that’s very familiar but at the same time totally upends our ideas about nature," Garner said. She sees this reflected in many books written prior to the 20th century. "You find things that are grounded in reality and things that are total fantasy."

Ulisse Aldrovandi's basilisk The New York Academy of Medicine

Like the Harry Potter series, these books often look at elements from the natural world through a fantastical lens. When describing mandrakes, an encyclopedia of natural history depicts the real plants as tiny creatures with human bodies and leaves sprouting from their heads. It even instructs readers to don earmuffs before harvesting them—just like Harry learns to do in his Herbology course.

A pair of mandrakes from the 15th-century "Hortus Sanitatis" The New York Academy of Medicine

The New York Academy of Medicine was established in 1847 as a public health organization, and today it’s home to one of the most impressive historical libraries of medicine in the world. The rare books room is open to the public by appointment, and a special exhibit of books in the Harry Potter collection may be offered in the near future. For now, the select texts are available online. "How to Pass Your O.W.L at Hogwarts" goes live on Monday, June 26, just in time for the 20-year anniversary of Harry Potter and the Philosopher’s Stone. Muggles can visit the academy's website to relive Harry's literary experiences—minus the biting and screaming textbooks.