There are about 320 students at Hogwarts. How do we know?
In order to unravel this mystery, we need to step out of the stories themselves. We need to understand the way that Rowling thinks about the books. Rowling is very, very visual. She writes the kind of visual language that makes a film so much fun to watch. She has a knack for adding the kind of comedy timing that usually can only be communicated visually. Want an example? How about the comedy timing in this exchange, from Goblet of Fire:
The bell was due to ring at any moment, and Harry and Ron, who had been having a sword fight with a couple of Fred and George’s fake wands at the back of the class, looked up, Ron holding a tin parrot and Harry, a rubber haddock.
“Now that Potter and Weasley have been kind enough to act their age,” said Professor McGonagall, with an angry look at the pair of them as the head of Harry’s haddock drooped and fell silently to the floor – Ron’s parrot’s beak had severed it moments before – “I have something to say to you all…”
This visual style is one of Rowling’s greatest strengths, but by her own admission, math is definitely not. We can use our understanding of the way she thinks to understand some of the math-related mysteries in the books. She “sees” the stories in her mind without having a specific quantity associated with them. So when she says that the Great Hall scene in the films is “exactly right,” we can assume that the number of students looks right to her. Since we know that there were about 320 children in that scene in the film, we can assume that 320 students is correct, regardless of what she says in an interview. The number 320 is visually correct, and that’s the way Jo sees the stories.
This number conveniently fits with almost every clue in the books as well.