Sorting Hat
From Hpwiki
The Sorting Hat is Gryffindor's old hat, imbued with the personalities of all four founders. It refers to itself as a "thinking cap".
The Sorting Hat sorts new students into one of the four houses at the start of term feast. For this purpose, the child sits for a moment with the hat on his/her head, until the hat has read its mind sufficiently -- possibly using a form of Legilimency -- to declare the house that fits best.
When not performing its annual sorting function, the Sorting Hat "lives" in the Headmaster's Office where it occasionally dispenses advice to the Headmaster and thinks of new Sorting Songs that it sings before the actual Sorting begins.
In Deathly Hallows, Voldemort sets the hat and Neville Longbottom on fire. However, the hat seemed to be intact afterwards, since Neville pulls the Gryffindor's Sword out of it.
Also, Harry explains to his son, Albus Potter, that he can always ask the hat to be in Gryffindor.

