# HTML Entity Encoder & Decoder

> Convert characters to HTML entities and back — escape markup safely for display.

To encode HTML entities, paste text containing angle brackets, ampersands or quotes and they are replaced with safe entity references. This is the standard defence against cross-site scripting when displaying untrusted content inside a web page.

**URL:** https://convertto.tech/t/html-entity-encode-decode
**Category:** Encoders & Decoders (https://convertto.tech/c/encoding-tools)
**Privacy:** Runs entirely in the browser; no upload
**Cost:** Free, no sign-up
**Last updated:** 2026-08-01

## Key facts

- **Privacy:** Runs entirely in your browser — nothing is uploaded
- **Cost:** Free, unlimited, no sign-up

## How to use

1. Enter or paste your text or html.
2. Choose the direction.
3. Turn "Encode all non-ASCII" on or off as needed.
4. The result appears immediately — copy or download it.

## FAQ

### Which characters must be escaped in HTML?

At minimum < > & in text content, plus quotes inside attribute values. Failing to escape & silently breaks entities, and failing to escape < is how untrusted content becomes executable script.

## Related tools

- [HTML Formatter](https://convertto.tech/t/html-formatter): Format and indent HTML properly, preserving inline elements and whitespace sensitivity.
- [Content Security Policy Generator](https://convertto.tech/t/csp-generator): Build a CSP header from common presets, with each directive explained.
- [Data URI Generator](https://convertto.tech/t/data-uri-generator): Turn text, SVG or CSS into a data: URI you can inline directly in HTML or stylesheets.
- [JWT Decoder](https://convertto.tech/t/jwt-decoder): Decode a JSON Web Token to inspect its header, payload and expiry — locally, never sent anywhere.
- [Punycode Converter](https://convertto.tech/t/punycode-converter): Convert internationalised domain names to Punycode and decode xn-- domains back.
- [URL Encoder & Decoder](https://convertto.tech/t/url-encode-decode): Percent-encode text for safe use in URLs, and decode encoded URLs back to readable text.
- [Excel to HTML Converter](https://convertto.tech/t/excel-to-html): Convert an Excel sheet into an HTML table.
- [HTML to EPUB Converter](https://convertto.tech/t/html-to-epub): Package HTML articles into a valid, reflowable EPUB 3 ebook.
