HTML Entities Encoder / Decoder

Convert special characters into HTML entities, and entities back into readable text. Escape just the reserved characters (& < > " '), every non-ASCII character such as accents, symbols and emoji, or everything, using named (&copy;), decimal (&#169;) or hexadecimal (&#xA9;) entities.

  • 100% free
  • No sign-up
  • Private & local
  • Works on mobile
Common HTML entities
CharNamedDecimalHex

Private by design: every calculation runs locally in your browser. Nothing you type is sent to a server or stored by us.

What Are HTML Entities?

HTML entities are codes that represent characters in HTML. They start with an ampersand and end with a semicolon, like &lt; for "<" or &copy; for "©". Some characters have special meaning in HTML: < and > start and end tags, & starts an entity, and quotes delimit attribute values. If you want these characters to appear as text on a page rather than be interpreted as code, you must encode them. Entities are also used to write characters that are hard to type or might be mangled by an incorrect character encoding, such as €, —, é or non-breaking spaces.

This free tool works in both directions. Encode plain text into safe HTML, choosing which characters to escape and the entity style. Decode entity-filled text, such as content copied from HTML source, RSS feeds, databases or APIs, back into normal readable characters. Named, decimal and hexadecimal entities are all supported.

How to Encode or Decode HTML Entities

  1. Choose the direction: encode or decode.
  2. Paste your text or HTML into the input box.
  3. For encoding, choose which characters to convert and whether to use named, decimal or hex entities.
  4. Copy or download the result, or reverse it with one click.

The Five Essential Entities

CharacterEntityWhy it must be escaped
&&amp;Starts every entity
<&lt;Starts a tag
>&gt;Ends a tag
"&quot;Ends double-quoted attribute values
'&apos; / &#39;Ends single-quoted attribute values

Encoding and Security

Escaping these five characters is the core defence against cross-site scripting (XSS). If a website inserts user input into a page without escaping it, an attacker can inject <script> tags that run in other users' browsers. Encoding turns the input into harmless text. In real applications, rely on your framework's automatic escaping or a well-tested library, and escape according to context (HTML body, attribute, URL or JavaScript). This tool is ideal for preparing snippets, documentation and examples by hand.

Named vs Numeric Entities

Named entities such as &eacute; are easier to read but exist only for about 2,000 characters. Numeric entities work for any Unicode character, including emoji: decimal &#128512; or hexadecimal &#x1F600; both produce 😀. Today most pages use UTF-8, so you rarely need to encode accents or symbols. Encoding the five reserved characters is usually enough, but full encoding is useful for ASCII-only systems, email templates and some XML formats.

Features

  • Encode and decodeBoth directions, with one-click reversal.
  • Three encoding scopesReserved only, all non-ASCII, or everything.
  • Three entity stylesNamed, decimal and hexadecimal.
  • Complete decodingAll 2,000+ named entities plus numeric ones.
  • Emoji supportCorrect handling of characters outside the basic plane.
  • Line breaksOptional newline ↔ <br> conversion.

Entities in XML, JSON and Other Formats

XML supports only five predefined entities (&amp;, &lt;, &gt;, &quot;, &apos;) plus numeric references, so named entities like &copy; or &nbsp; will break an XML or RSS feed unless they're declared. When preparing content for XML, choose the decimal or hex style. JSON doesn't use HTML entities at all; it escapes characters with backslashes (such as é), so decode entities before putting text into JSON. Markdown generally passes HTML entities through to the final page unchanged, which makes them a handy way to insert special symbols.

Frequently Asked Questions

How do I encode emoji as HTML entities?

Choose "Reserved + all non-ASCII" and decimal or hex style. An emoji becomes a numeric entity such as &#128512;.

What's the difference between &#39; and &apos;?

Both produce an apostrophe. &apos; is valid in HTML5 and XML, while &#39; also works in old HTML4 browsers.

Why do I see &amp;amp; in my text?

The text was encoded more than once. Decode it repeatedly (use the reverse button) until the entities disappear.

How do I display < and > on a web page?

Encode them as &lt; and &gt;. Paste your code here with "Reserved only" selected to escape it.

What is &nbsp;?

A non-breaking space: a space that prevents a line break between two words and isn't collapsed by the browser.

How do I decode &amp; and similar codes?

Choose "Decode entities → text" and paste the text. All entities are converted back to characters.

Do I need to encode accented letters?

Not if your page uses UTF-8 (the standard). Encoding them is only needed for systems that can't handle Unicode.

Is my text uploaded?

No. Encoding and decoding happen in your browser.