HTML Entity Tool
100% client-side, nothing leaves your browser

HTML Entity Encoder / Decoder

Convert text to HTML entities or decode entities back to plain text, with named and numeric support, live preview, and validation.

Encode or decode

No signup. No server calls. Works offline once the page loads.

Action
Entity type (encode)
0 characters
0 characters

Live preview

Shown as escaped text — markup in your input is never executed.

How It Works

1

Enter your text

Type plain text to encode, or paste HTML entities to decode.

2

Choose entity type

Pick named, decimal, or hexadecimal entities when encoding — decoding accepts all three automatically.

3

Preview & copy

Check the live preview and character count, then copy the result.

Privacy note: everything happens locally in your browser using JavaScript. Nothing is sent to a server, and no markup is ever executed.

Common Uses

Embedding code samples

Safely display <tags> and & symbols inside HTML documentation.

Sanitizing user input

Preview how untrusted text would render once entity-escaped for display.

Reading scraped HTML

Decode entity-laden text pulled from web pages back into readable text.

Writing CMS content

Insert special characters like ©, ™, or curly quotes using their entity codes.

Frequently Asked Questions

What is an HTML entity?

An HTML entity is a piece of text that begins with an ampersand and ends with a semicolon, used to represent characters that would otherwise be interpreted as markup, such as &lt; and &amp;, or characters that are hard to type directly.

What is the difference between named and numeric entities?

A named entity uses a mnemonic like &amp; or &copy;, while a numeric entity references a character by its Unicode code point, either in decimal (&#169;) or hexadecimal (&#xA9;) form. Both render identically in a browser.

Why do I need to encode HTML entities?

Encoding is necessary whenever you insert user-provided or special text into an HTML document, so that characters like < and & are displayed literally instead of being parsed as markup.

Is this tool safe to use for untrusted input?

The tool encodes and decodes text locally in your browser and does not execute the resulting HTML, so it's safe to inspect untrusted strings without risk of running embedded scripts.

Does the live preview render my HTML?

The live preview shows how decoded text would visually appear, escaping it safely so that any markup in your input is displayed as text rather than executed.

Can this tool encode emoji and non-Latin scripts?

Yes. Any character outside the basic named-entity set can be converted to its numeric character reference, which correctly represents emoji, Urdu, Arabic, Chinese, and other scripts.

More Tools

Want to know when to use HTML entities vs URL encoding vs Base64? Read the Encoding Cheat Sheet →

Copied