HTML Entity Encode / Decode
Encode and decode HTML entities, including all 2,231 named references.
Minimal encodes only & < > " and ', which is all that is needed to make text safe inside HTML. Named output uses HTML 4 names, with numbers for ' and for characters that have no HTML 4 name.
Think a result is wrong? Report it on GitHub
About HTML entities
Free HTML entity encoder and decoder. Escape text as named, decimal or hex entities, or decode all 2,231 named references. Runs entirely in your browser.
In HTML, <, > and & have special meanings, and quotes end attribute values. To show them as text, they are written as character references, such as < or <. Escaping these five characters is the basic defence against injected markup and cross-site scripting (XSS) when putting text into a page.
Named, decimal or hexadecimal?
All three mean the same to a browser. Named references like é are easier to read; numeric ones like é or é work for every character. This tool uses only the 252 names from HTML 4 when encoding, because every parser knows them. When decoding, it recognises all 2,231 names in the current HTML Standard.
Why does ¬it; decode to ¬it;?
For historical reasons, a few old names such as ¬ and © work without the closing semicolon. Browsers match the longest known name, and this tool follows the same rule, so the output matches what a browser would show.
Is the preview safe?
The preview runs in a locked-down frame: scripts cannot run, and nothing is loaded from the web, so a tracking image in pasted HTML cannot report back.