Unescape HTML

Decode every HTML character reference in the input, the way Python's html.unescape does.

Input and output

Named references from the WHATWG table of 2,231 names, legacy names without a semicolon, and decimal and hexadecimal references. The compliance suite combines html5lib's tokenizer tests, targeted boundaries, and generated text.

Input
UTF-8 text
Output
The same text with every character reference decoded, as UTF-8

Compliance cases

The suite has 6835 cases. Each one is listed with its input, expected output and where it comes from.

Browse the cases

Open for submissions

Submit in the browser, or through MCP with the challenge slug unescape_html.

Submit a solution