At Hogwarts, the Sorting Hat was a living magical hat that identified which one of the four Houses every new student belonged to the most. Gryffindor, Hufflepuff, Ravenclaw, and Slytherin were the four Houses. Godric Gryffindor, was one of Hogwarts’ four founders, was the initial owner of the Sorting Hat. It was generally kept in the Headmaster’s office before it was required.
In a series of songs, the famed Hogwarts sorting hat quiz recounted its origins. There at beginning of each term year, the first-year pupils were queued up and their names were read out alphabetically. The hat was then placed on each person’s head as they sat on a stool.
By 1991, the hat had become damaged and worn; it was patched, tattered, and filthy. A tear all along the brim expanded like a mouth to speak and sing. It communicated to the wearer within the hat in a little, quiet voice, utilising Legilimency to interpret and respond to their thoughts. After some deliberation, the hat proclaimed its decision loudly for everyone to listen, and the student was sent to the chosen residence. The evaluation period ranged from less than a second to more than 5 minutes (known as “hatstall”).
The sorting hat quiz seemed legendary for refusing to accept that it had ever sorted a pupil incorrectly. When Slytherins acted altruistically or selflessly, Ravenclaws flunked all of their examinations, Hufflepuffs were lazy but academically bright, and Gryffindors were cowardly, the Hat stood firm in its initial choice. On the whole, though, the Hat has made very few mistakes throughout its many years of operation.
According to legend, the Sorting Hat was fashioned around a thousand years ago and originated as a regular hat owned by Godric Gryffindor. When Gryffindor and the other founders, Salazar Slytherin, Rowena Ravenclaw, and Helga Hufflepuff, questioned how they would continue to sift the students after the four were gone, Gryffindor removed his hat from his head and charmed it with their collective wisdom. All four founders sought to guarantee that students were assigned to their eponymous homes, which were chosen based on each founder’s student preferences.
The Sorting Hat, fully alive, was responsible for sorting and splitting students into Hogwarts Houses, and did so for a millennium, handing it down to every new Headteacher of the institution. It is kept on a bookshelf in the existing Headmaster’s or Headmistress’s room while not in use.
One of the creators so far, the only known relics, Godric Gryffindor’s Sword, could be magically plucked out from the hat by any Gryffindor deemed worthy, no despite how secure the sword’s placement. It was uncertain why it was possible, but it was associated with extreme allegiance to Hogwarts.