@technobuddha > library > Programming > Escaping
Function: unescapeHTML()
ts
function unescapeHTML(input: string): string;Defined in: unescape-html.ts:23
Unescape a string encoded in HTML
| Escape Sequence | Character |
|---|---|
| &#n…; | Numeric character |
| &#xn…; | Hexadecimal character |
| &xc…; | Named entity |
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | The string to unescape |
Returns
string
the string with escapes resolved
Example
typescript
unescapeHTML('Hello & World'); // "Hello & World"
unescapeHTML('2 < 3 > 1'); // "2 < 3 > 1"
unescapeHTML('© 2025'); // "© 2025"
unescapeHTML('😀'); // "😀"