Developer tools
HTML entity encoder and decoder
Encode &, <, >, double quotes and apostrophes. Decode amp, lt, gt, quot, apos and nbsp plus decimal and hexadecimal numeric references with a semicolon. Decoding is one pass; unknown names remain unchanged. Nonbreaking space remains U+00A0. Zero, surrogate and out-of-range references are rejected. The output is displayed as plain text. This is not an HTML parser or an HTML sanitiser; escaping is not safe for every script or URL context.
Paste text, choose options and calculate. Up to 20,000 UTF-16 code units (an emoji can use more than one). Empty input is allowed except for naming conversion.
Result
Method:
Processing stays in this browser tab. Input is not sent, saved in browser storage or added to the URL. The original TXT download contains the result. The additional JSON export contains the input, selected options and exact result. Copy may require permission; selecting text is available as a fallback. Changing an input clears the previous result. Optional own UTF-8 file up to 32 KiB and 20000 UTF-16 units; raw file and form line endings are recorded separately. CSV protects formula-like lines with an apostrophe; printable HTML refuses unsupported control characters. Optional live calculation is off by default.
How it works
Encode &, less than, greater than, double quotes and apostrophes. Decode amp, lt, gt, quot, apos and nbsp plus decimal and hexadecimal numeric references with a semicolon. Decoding is one pass; unknown names remain unchanged. Nonbreaking space remains U+00A0. Zero, surrogate and out-of-range references are rejected. The output is displayed as plain text. This is not an HTML parser or an HTML sanitiser; escaping is not safe for every script or URL context. Shared own file and JSON/numbered-line CSV/printable HTML exports record the unchanged calculation result and actual selected options. Processing stays in this browser tab. Input is not sent, saved in browser storage or added to the URL. The original TXT download contains the result. The additional JSON export contains the input, selected options and exact result. Copy may require permission; selecting text is available as a fallback. Changing an input clears the previous result. Optional own UTF-8 file up to 32 KiB and 20000 UTF-16 units; raw file and form line endings are recorded separately. CSV protects formula-like lines with an apostrophe; printable HTML refuses unsupported control characters. Optional live calculation is off by default.
Worked example
Example input: ‹p›Hello & goodbye‹/p›
Frequently asked questions
How do I encode special characters as HTML entities?
Choose encode. The tool escapes ampersand, less than, greater than, double quotes and apostrophes. For example, Own with angle brackets, an ampersand and quotes becomes entity text such as < and &.
Which entities can the decoder read?
Amp, lt, gt, quot, apos and nbsp, plus decimal and hexadecimal numeric references with a semicolon.
What happens to unknown entity names?
Decoding is one pass, and unknown names remain unchanged.
Which numeric references are rejected?
Zero, surrogate and out-of-range references are rejected.
Is this an HTML sanitiser?
No. It is not an HTML parser or an HTML sanitiser, and escaping is not safe for every script or URL context.
How much text can I convert?
Up to 20,000 UTF-16 code units, or an optional UTF-8 file of up to 32 KiB.