The Eriovixia gryffindori, measuring just 7mm in length, closely resembles the magical artefact in the series.
The spider takes its name from Godric Gryffindor, the fictional owner of the hat.
It was discovered in the mountainous Western Ghats region of south-western India.
"We were searching the area (when) we bumped into the spider," Javed Ahmed, one of three researchers who made the discovery, told the BBC's Five Live.
"When we found it we decided that we were going to name it after the sorting hat," the self-professed fan said.
The spider is an "ode to draw attention to the fascinating, but oft overlooked world of invertebrates,", said the scientists in a paper published by the Indian Journal of Arachnology.
The spider mimics dried foliage in order to hide from its predators.
The find did not go unnoticed by JK Rowling, the author of the wizarding books.