Show HTML code as text on a web page, escape user content, or turn &-filled text back into readable characters.
How to use the HTML Entity Encoder / Decoder
- 1 Choose Encode or Decode.
- 2 Paste your HTML or text.
- 3 Copy the result.
Worked examples
Input: <p class="note">Fish & Chips</p>
Result: <p class="note">Fish & Chips</p>
Input: © 2026 — café
Result: © 2026 — café
Named entities
Which characters must be escaped?
| Character | Entity |
|---|---|
| & | & |
| < | < |
| > | > |
| " | " |
| ' | ' |
Escaping these five prevents text from being interpreted as markup — the core defence against cross-site scripting (XSS) when inserting user content into HTML.
Encoding all non-ASCII characters
Modern pages served as UTF-8 do not need accented letters or emoji encoded, but some email templates and legacy systems do. Tick "Encode all non-ASCII" to output numeric entities such as é.
Runs locally
Everything happens in your browser — nothing you paste is uploaded or logged, so it is safe to use with API responses, tokens and internal data.
Frequently asked questions
What is an HTML entity?
A text code that represents a character, such as < for < or © for ©.
Is decoding safe?
Yes. Decoding happens in an isolated element that never executes scripts or loads resources.
Named or numeric entities?
Both are decoded. Encoding uses the five essential named entities plus numeric codes for non-ASCII when selected.
Related tools
JSON Formatter & Validator
Format, beautify, minify and validate JSON with syntax highlighting, key sorting and precise error locations.
Base64 Encoder
Encode text to Base64 (UTF-8 safe), with URL-safe and MIME line-wrapping options.
Base64 Decoder
Decode Base64 and URL-safe Base64 back to UTF-8 text, with clear errors for invalid input.
URL Encoder / Decoder
Percent-encode or decode URLs and query parameters, as a component or a full URI.
Regex Tester
Regex tester for JavaScript regular expressions: live match highlighting, capture groups and replace preview.
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of text or files, and verify checksums.