Ms Rowling was asked by a fan to explain why some people in the stories - including the hero Harry Potter - are referred to as "half-blood" wizards.
She replied that the terms "half-blood" and "pure-blood" were used by prejudiced characters such as the evil Lucius Malfoy and the Death Eaters, servants of arch-villain Lord Voldemort.
Ms Rowling said she had invented the idea that some wizards were not considered to be "pure", and realised the similarities with the Nazis’ beliefs only afterwards when she visited a museum dedicated to the Holocaust, in which six million Jewish people died.
Her decision to talk about such a sensitive issue was welcomed by an education officer at The Jewish Museum, who said the stories could be used to help children deal with racism in the playground.
Ms Rowling, writing on the website she set up as a way of responding to the thousands of questions and requests she receives from all over the world, said she had been asked why people such as Harry Potter were called half-blood "even though both their parents were magical".
She replied: "The expressions ‘pure-blood’, ‘half-blood’ and ‘muggle-born’ have been coined by people to whom these distinctions matter and express their originators’ prejudices.
"As far as somebody like Lucius Malfoy is concerned, for instance, a muggle-born [wizard] is as bad as a muggle. Therefore Harry would be considered only half-wizard because of his mother’s grandparents."
Ms Rowling then explained how she had discovered that this fictional prejudice held by some wizards against non-magical people [muggles] bore a strong resemblance to the way the Nazis thought.
"If you think this is far-fetched, look at some of the real charts the Nazis used to show what constituted ‘Aryan’ or ‘Jewish’ blood," she said.
"I saw one in the Holocaust Museum in Washington when I had already devised the ‘pure-blood’, ‘half-blood’ and ‘muggle-born’ definitions and was chilled to see that the Nazis used precisely the same warped logic as the Death Eaters.
"A single Jewish grandparent ‘polluted’ the blood, according to their propaganda."
Susannah Alexander, an education officer at The Jewish Museum in London, broadly welcomed Ms Rowling’s comments on the bloodline aspect of her stories.
"She’s exactly right, they [the Nazis] graded people according to their genetics in a totally revolting and warped way," she said.
"I personally think that if we avoid these issues and brush them under the carpet, we are giving the green light to people who might try and expose young people to the alternative point of view, which doesn’t bear thinking about.
"We are in danger of saying these issues are too big, too frightening and not deal with them altogether."
Miss Alexander, who has taught children about the Holocaust, said she had picked up on striking similarities between the Nazis’ beliefs and those held by the evil characters in the Harry Potter books, all of which she has read.
"The second book in particular deals very much with this idea of pure blood and half-blood. It never seemed to me that some of the expressions and the language used came entirely from an author’s imagination," she said.
"In one particular instance, Hermione is being picked on for having muggle parents. They call her ‘mud-blood’, dirty blood. That always seemed to me to have a basis in language used by the Nazis."
While children reading the books themselves might not pick up on this, Miss Alexander said, it might be used by teachers as a way to discuss racism.
"It may well be these issues are real issues that children are facing in the playground. In inner-city schools particularly, classrooms are made up of children from all sorts of backgrounds. Probably most children reading the books wouldn’t pick up on it. But I could see it being explored in the classroom, although it would need sensitive handling."
Dr Kenneth Collins, president of the Glasgow Jewish Representative Council, said that Ms Rowling’s books could deal with serious issues in a way that younger readers could understand.
"JK Rowling seems sensitive to the issues and is careful how she’s using it," he said.
"I think a good children’s writer can introduce adult types of topic in her books. It is the way in which she handles things that’s important, so I don’t really think I’ve got any problems with it."
The Harry Potter books have come under intense scrutiny from a host of academics and other commentators seeking to read between the lines.
American professor of English, Craig Svonin, who wrote a paper on political aspects of the stories, had previously commented that the "discussion of Mudbloods mirror our real-world issues of white supremacy, miscegenation and Nazi-esque ideas of racial purity".
While Prof Svonkin stressed that the subject was addressed as part of a "liberal-humanist call for understanding", he said he was concerned by the portrayal of the "house-elves", who serve their wizard masters and who with one exception do not want to be free.
He described this as "a very troubling stereotype, that of the willing slave, and the fact that Rowling would include such a stereotype is very difficult to ignore or explain away".
Harry Potter has also been variously described as a Thatcherite apostle of consumerism, a Trotskyite revolutionary, a Nietzschean, a Stoic and Jesus.
The books have also been condemned by feminists for having only one major female character and by Christian fundamentalists for talking about magic and witchcraft.
A lawyer, Susan Hall, even analysed the wizard’s legal system and decided the Ministry of Magic was run in contravention of the European Convention on Human Rights.
Ms Rowling and her agent Chistopher Little were both unavailable for comment.