HTML Entity Encoder / Decoder
Paste text to escape it for safe use in HTML, or paste entity-encoded text to read it. Choose named entities or numeric codes.
Result
Type text to convert it.
About this tool
Characters like <, > and & have special meaning in HTML; showing them literally requires entities such as < and &. Non-ASCII characters — accents, currency symbols, arrows — can be written as named entities (é, €, →) or numeric references (é) so they survive any document encoding. Escaping user input is also the first line of defence against cross-site scripting.
Encode mode always escapes the five HTML-critical characters and, by default, everything outside ASCII too. Decode mode understands named, decimal and hexadecimal references. Both run entirely in your browser.
Frequently asked questions
- Named or numeric — which should I use?
- Numeric references work in every HTML and XML parser. Named ones are easier to read but a few are HTML-only.
- Does encoding replace spaces with ?
- No. Normal spaces are kept; only the non-breaking space character becomes .
- Is this the same as URL encoding?
- No. URL encoding uses %20-style escapes for addresses. Use the URL Encoder for that.