Operation
Format
Characters to encode

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.

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 &lt; or &#60;. 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 &eacute; are easier to read; numeric ones like &#233; or &#xe9; 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 &notit; decode to ¬it;?

For historical reasons, a few old names such as &not and &copy 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.