Text and developer tools

HTML entity encoder and decoder

Encode HTML’s five special characters or decode semicolon-terminated named and numeric character references locally.

Runs in your browser. Inputs stay on this page and are not uploaded or added to the URL.

Up to 100,000 characters. Decoding requires a terminating semicolon.

How to use this tool

Encoding replaces ampersand, less-than, greater-than and both quotation marks so ordinary text can be represented as HTML text. Decoding reads complete named references supported by your browser and decimal or hexadecimal numeric references. It does not execute or render decoded HTML.

Decoding makes one pass: < becomes <, not a less-than sign. Unknown names and references without a semicolon remain unchanged. Numeric references follow HTML replacement rules for invalid scalars and legacy C1 controls. Entity encoding is not a general-purpose sanitizer for scripts, CSS or arbitrary HTML.

Worked example

Text A & B encodes as A & B. The reference 😀 decodes to 😀.

References and method

Contifield is an independent utility site. Reference publishers do not endorse this tool.

Related tools