HTML Entities
Escape &, < and > for HTML, or unescape them.
About HTML Entities
An HTML entities encoder and decoder that escapes &, <, >, quotes and a few symbols as named entities, or unescapes named, decimal and hex entities.
How to use
- Choose Escape to make text safe to place inside HTML, or Unescape to turn entities back into characters.
- Type or paste into the left pane. The result appears on the right as you type, with a Copy button.
- Press Clear to start again.
What it supports
- Escape replaces exactly these 11 characters:
&<>"'©®€£¥¢with&<>"'©®€£¥¢. Every other character, including emoji and accented letters, passes through unchanged, which is correct for UTF-8 pages. - Unescape handles every named entity in the HTML5 list (
,—and the rest), any decimal entity such as©and any hex entity such as©, exactly one level at a time:&lt;becomes<, not<. - Escape is enough to display user text or code samples inside an element or a quoted attribute. It does not sanitise HTML, strip tags, or make text safe inside a
<script>block or a URL.
Example
<a href="/">Tom & Jerry</a>
→ <a href="/">Tom & Jerry</a>
Privacy
Escaping is string replacement. Unescaping hands the text to the browser's own parser inside a detached textarea, whose content is text, so nothing is rendered or run. No request is made, and nothing is stored.
Frequently asked questions
- Which characters must be escaped in HTML?
- Five: & as &, < as <, > as >, " as " and ' as ' or '. The first three matter in text content; the quotes matter inside attribute values. Everything else can be written literally in a UTF-8 document.
- What is the difference between © and ©?
- Both are the copyright sign ©. © gives the Unicode code point in decimal and © gives it in hexadecimal; any code point up to U+10FFFF can be written either way, with or without a named form such as ©.
- Does escaping HTML entities prevent XSS?
- Escaping &, <, >, " and ' prevents user text from being read as markup when it is placed in element content or a quoted attribute, which stops the most common cross-site scripting. It is not sufficient inside JavaScript, CSS, URLs or unquoted attributes, which need their own encoding.