HTML Entities · Encode & Decode

Every special character, safely escaped.

Paste raw text or markup and get perfectly escaped entities — or paste an entity string and get the original characters back. Named, decimal and hex styles, full Unicode coverage, zero uploads.

  • 100% client-side — nothing uploaded
  • Free, no sign-up
  • Auto-detects direction
escapehtml — entity checkpoint 0 ch
Direction Style
Input0 entities
Output0 ch
// Output appears here — start typing or paste on the left.

A checkpoint for every character

Built for developers who render user input and for anyone who ships multilingual email.

&

Three Entity Styles

Named entities for readability, decimal for legacy mail systems, hex for URLs and JavaScript — switch styles with one click and compare instantly.

你

Unicode Lossless

Turn on the Non-ASCII option and Chinese, Arabic, Cyrillic or emoji become numeric code points like 你 — text survives any transport, UTF-8 or not.

XSS-Safe by Default

The five critical characters & < > " ' are escaped first, so injected markup becomes inert text before it ever reaches the DOM.

HTML entities cheat sheet

The five characters that must be escaped, in every style the tool supports.

CharacterMeaningNamedDecimalHex
&Ampersand&amp;&#38;&#x26;
<Less than&lt;&#60;&#x3C;
>Greater than&gt;&#62;&#x3E;
"Double quote&quot;&#34;&#x22;
'Single quote&#39;&#39;&#x27;

built for the moments before you ship

Paste a string containing ampersands, angle brackets, or quotes and this tool converts them into the exact entity format your target context expects. It serves developers preparing template literals, content managers pasting multilingual text into CMS fields, and QA engineers verifying that user-generated input renders as visible text rather than executable markup. The encoder handles Non-ASCII characters like 你 alongside standard punctuation, so a single paste covers both ASCII symbols and CJK or accented characters without a second pass through a separate converter.

from pasted text to entity-safe output

  1. Paste or type your raw text into the input area, or click Sample to load a demonstration string.
  2. Tick Escape quotes if your output needs single and double quotes converted to their respective entities.
  3. Press Encode to transform the input, or click Auto to let the tool detect and apply the correct direction.
  4. Switch between Named, Dec, and Hex to choose the entity notation style used in the result.
  5. Review the output panel, then click Copy Output to place the encoded text on your clipboard.

Frequently Asked Questions

How do I encode HTML entities?

Paste or type your text into the left pane. EscapeHTML encodes it instantly — ampersands, angle brackets and quotes become entities such as & < > ". Pick the Named, Decimal or Hex style in the toolbar, then click Copy Output.

How do I decode HTML entities back to text?

Paste the encoded string (for example "Tom &amp; Jerry") into the input pane. Auto mode detects the entity pattern and decodes it to plain text immediately. You can also force decoding with the Encode / Decode switch.

What is the difference between named, decimal and hex entities?

Named entities use readable words like &amp; and &lt;. Decimal entities use the character's code point in base 10, like &#38;. Hex entities use base 16 with an x, like &#x26;. All three render identically in browsers — hex is common in URLs and JavaScript, decimal in older email systems.

How does the auto-detect mode work?

Auto mode scans the input for entity patterns such as &#123;, &#x4F60; or &lt;. If entities outnumber the raw special characters, the input is treated as encoded text and is decoded; otherwise it is treated as raw text and is encoded.

How are non-ASCII characters like Chinese handled?

Enable the Non-ASCII option and every character above code point 127 — including Chinese, Japanese, Korean, Arabic and emoji — is converted to a numeric entity such as &#x4F60; for 你. This keeps multilingual text lossless across systems that are not UTF-8 safe, such as some email template engines.

Does escaping HTML prevent XSS attacks?

Encoding the five critical characters & < > " ' before rendering user input is the core defense against reflected and stored XSS: it turns active markup like <script> into inert text. Always escape on output in the context where the data will be rendered, and combine it with a Content Security Policy.

Is my text uploaded to a server?

No. The entire encoder and decoder runs in your browser with client-side JavaScript. Nothing you paste is transmitted, logged or stored, so the tool is safe for private source code, customer data and email templates.

Can I use entities in email templates?

Yes. Email clients are stricter than browsers — some strip or misread raw special characters. Encoding them as entities (and turning non-ASCII characters into numeric code points) keeps symbols, quotes and CJK text intact across Outlook, Gmail and Apple Mail.

The entities you actually type

Every entry gives the character, its named form, the decimal and hexadecimal equivalents, and what this encoder emits for it — which is not always the named form you expect.

Latest Articles

How to Convert Plain Text Strings to HTML Entities Using Client Side Tools
Picture two scenarios. In the first, a user types script alert('hi') /script into your comment box, and your app slaps that string directly into the DOM.
Complete HTML Entity Cheat Sheet for Special Characters and Web Security
If you're rendering user-generated content and only escaping and , you're leaving the door wide open.
Frontend Developer Guide to Escaping HTML Special Characters for Xss Prevention
Before we dive into the deep end of cross-site scripting (XSS) prevention, let’s fix the most immediate vulnerability in your current codebase right now.
When to Use Unicode Encoding Instead of Named HTML Entities
Here's a mistake I see in nearly every web-based developer tool codebase I audit: developers reach for mdash; , hellip; , copy; , and rsquo; like they're some kind of universal safety net.
Safely Unescape HTML Strings Locally: End-to-End Walkthrough
Safely unescape HTML strings locally without server side processing. Follow this friendly, step-by-step developer tools workflow to secure your data today.
HTML Entities: Decode Hex vs Decimal Escapes
Learn the difference between hex and decimal HTML entities for escaping characters. Follow this end-to-end workflow to fix rendering bugs fast. Read now!
Client-Side HTML Encoding: Stop XSS 3 Simple Steps
Secure dynamic web apps! Learn how client-side HTML entity encoding prevents XSS in just a few simple steps. Read our tutorial and start coding safely today!
Escape HTML in JSON: 2 Approaches Weighed 2026
Weighing two ways to escape HTML in JSON payloads? We compare manual regex vs native encoders using a real 50KB payload. Pick the right tool for 2026 security!
3 Mistakes: Named vs Hex HTML Entities Frontend Code
Stop guessing which HTML entities to use. Learn exactly when named vs hex entities matter for frontend performance and accessibility. Read our guide today!
Converting Unicode Text to Decimal HTML Entities With a Client-Side Tool
Decimal entities are the code point in base ten, so the payload survives any transport that mangles bytes. Here is what really changes between named, decimal and hex output.
Render User-Generated HTML Safely: Block Comment XSS Risks
Building a comment section? Discover exactly how to safely render user-generated HTML strings without exposing XSS risks. Grab the snippet and secure your app now!
HTML Entity Cheat Sheet: 50 Tests, Raw vs Encoded
We tested 50 symbols to build this HTML entity cheat sheet. Follow our workflow comparing raw Unicode vs encoded output. Stop rendering bugs. Read the data!
Best Practice to Escape HTML Special Characters in Vanilla JavaScript Frontend
So your browser-based JSON viewer just rendered a ` ` tag as live HTML — now what? You built a slick little API testing tool.
3 Times Unescape HTML Locally Crushed Server API Lag
Stop hitting server-side APIs to unescape HTML strings. See why local processing crushes latency, saves API budget, and simplifies dev workflows. Read more!
Stop Misusing HTML Entities: Hex, Decimal, Named
Stop mixing up unicode characters. Learn the exact difference between hex, decimal, and named HTML entities through one simple end-to-end workflow. Read it now.
How to Prevent XSS Vulnerabilities Using Client-side HTML Entity Encoding
This is the question that keeps frontend developers up at night, especially those of us building single-page applications where the browser does most of the heavy lifting.
HTML Entity Encoding Defeats 3 DOM XSS Payloads
Server-side string escaping leaves DOM gaps. Discover why client-side HTML entity encoding prevents XSS better via a real 3-payload breakdown. Read the guide.
Escape HTML: Prevent Client-Side XSS in 5 Minutes
Stop XSS attacks breaking your app. Learn how to securely escape HTML strings using hex and named entities for client-side XSS prevention. Read the guide now!
HTML Escaping 2026: 1 Real Example Stops XSS
Let's learn HTML escaping together! We will take one tricky character, convert it into hex and decimal entities to stop XSS. See the real numbers work today!
Unescape HTML Safely: XSS-Proof Client-Side Snippets
Safely unescape HTML strings client-side without triggering XSS vulnerabilities. Stop fighting sanitization nightmares and deploy secure code today. Read now!
How to Prevent DOM-Based XSS With Entity Encoding: Hex vs Named Entities
Hex and named entities are identical to the HTML parser, so the security debate is a myth. What actually matters is a complete escape set, the right context, and encoding exactly once.
Unescape HTML 2026: DOMParser vs innerHTML XSS Pitfalls
Unescape HTML client-side safely by contrasting innerHTML against DOMParser. Discover which method prevents XSS vulnerabilities. Read our pitfalls guide now.
Stop Broken DOM: Why HTML Escape Utilities Fail Silently
A broken dashboard showed why naive HTML escape utilities fail. Find reliable developer tools to safely unescape text in production. Read our full case study.
Step by Step Guide to Decoding HTML Entities Safely Without XSS Vulnerabilities
Last March, I was maintaining the content pipeline for a developer documentation platform — the kind of tool where users submit code snippets, error logs, and configuration files that get rendered in real-time for other developers to read.
Client-Side Text Encoding: 2 XSS Approaches (2026)
Compare two client-side text encoding utilities for XSS prevention step-by-step. Review evidence-led results to choose the safest method. Read the guide now.
How to Convert Special Characters to HTML Entities Online
Most beginners do this: they Google "HTML entity converter," paste their string into the first tool that pops up, copy the result, and slap it into their code.
Why Using HTML Entity Encoders Improves Frontend Web Security
That number comes straight from OWASP's latest testing data, and honestly, it still catches me off guard every time I read it.
HTML Entity Cheat Sheet: Resolve Unescaped Quotes
Unescaped quotes break DOM rendering. Use this HTML entity cheat sheet to fix text encoding flaws, secure inputs, and prevent XSS. Download the guide today.
Why Most Developers Unescape HTML Client Side Wrong
Stop breaking the DOM. Learn why developers unescape HTML client side wrong and discover safe, practical methods to fix common XSS mistakes. Read the guide.
Named vs Hex vs Decimal HTML Entities: What Actually Differs
All three notations resolve to the same character, so the choice is about coverage, length and the target parser. Worked reference lengths, the 2,231-name ceiling and where entities do not work.

View All Articles →