About this HTML entity encoder and decoder
Escape special characters like <, >, &, quotes and non-ASCII symbols into HTML entities, or decode entities such as &, <, , © and 😀 back to characters. Escaping is required whenever you display user-supplied text or want to show HTML source code on a web page, and it is the primary defence against cross-site scripting (XSS). Decoding is useful when an API, CMS export or RSS feed hands you text full of &amp; and ".
How to use the HTML Entity Encoder / Decoder
- Paste text, HTML source or entity-encoded content.
- Choose Encode to escape characters or Decode to turn entities back into text.
- Copy the result into your template, CMS or code.
Example
<a href="x">Tom & Jerry</a> → <a href="x">Tom & Jerry</a> © 2024 – café → © 2024 – café
Frequently asked questions
What are the five HTML characters that must always be escaped?
& as &, < as <, > as >, double quote as " and single quote as ' (or '). These are the characters that can change the structure of HTML or break out of an attribute.
What is the entity for a non-breaking space, copyright, dash and arrow?
Non-breaking space , copyright ©, registered ®, trademark ™, en dash –, em dash —, right arrow →, euro €, degree °, multiplication sign ×, ellipsis ….
What is the difference between named, decimal and hex entities?
They are three ways to write the same character: ©, © and © all produce ©. Named entities are readable but only exist for about 2 200 characters; numeric entities work for any Unicode code point.
How do I show HTML code on a web page without it rendering?
Encode it with this tool so every < becomes < and every > becomes >, then paste the result inside a <pre><code> block. The browser displays the tags as text instead of interpreting them.
How do I HTML-encode in C#, JavaScript, Python or PHP?
C#: System.Net.WebUtility.HtmlEncode / HtmlDecode (Razor and Blazor encode automatically). JavaScript: there is no built-in; set element.textContent instead of innerHTML, or use a small replace of & < > " '. Python: html.escape and html.unescape. PHP: htmlspecialchars and html_entity_decode.
Why does my page show &amp; or &quot; as text?
The text was encoded twice. Decode it once here to see the intended content, then find the place in the pipeline (template engine, CMS, API serializer) that is encoding already-encoded output.
Should I encode every non-ASCII character?
Not on modern UTF-8 pages: é, ü and emoji can be used directly. Encode them only when the output must be pure ASCII, for example in some email templates or legacy systems.
Is my data safe?
Yes. The tool runs entirely in your browser using WebAssembly. Nothing you type or upload is sent to a server, logged or stored.
Is it free?
Yes, completely free with no sign-up, no limits and no watermarks. It also works offline once the page has loaded.