Home/HTML Entity Encoder/Decoder

HTML Entity Encoder/Decoder – Encode and Decode HTML Entities Online

4.5 Rating from 134 people who voted
Share this page
HTML Entity Encoder/Decoder Convert characters to/from HTML entities with full control
Encode special characters to HTML entities or decode entities back to characters. Use the Reference tab to browse 150+ common entities.
Encoding Options
0
Characters
0
Entities
0
Output Length
0%
Size Ratio
Decoding Options
0
Characters
0
Entities Found
0
Output Length
0%
Size Ratio
Character Named Entity Decimal Hex Description

About the HTML Entity Encoder/Decoder

An HTML entity is a special code that represents a character which would otherwise be interpreted as markup or lost during rendering. This HTML Entity Encoder/Decoder converts characters into entities and converts entities back into readable characters, updating the output live as you type. You can encode using named entities such as <, decimal numeric references such as <, or hexadecimal references such as <, with an uppercase or lowercase hex toggle for consistent code style.

Four encoding options give you precise control: encode only the five HTML special characters, convert non-ASCII UTF-8 characters into numeric entities, encode every non-alphanumeric character, or enable double encoding so existing ampersands are converted as well. The decoder handles named and numeric entities independently, and a strict mode leaves anything that isn’t a valid entity untouched instead of guessing.

Developers reach for this tool when pasting code samples into a page, cleaning up scraped content full of " artifacts, or preparing text for XML and email templates. Once your entities are decoded back into readable markup, the HTML Beautifier re-indents that markup so the structure is easy to scan.

The Reference tab is a working lookup table of over 150 entities grouped into categories including Basic, Latin, Currency, Symbols, Math, Numbers, Arrows, Greek, Typography, Cards, Music, Shapes, Box Drawing, and Misc. Search by character, entity name, code, or description, then click any named, decimal, or hex cell to copy it straight to your clipboard.

Entity encoding is one of several escaping schemes you may need in a single workflow. When the same string also has to survive a query parameter, the URL Encoder/Decoder applies percent-encoding to the parts that HTML entities don’t cover.

Our team at BigToolSite validated both directions against nested entities, double-encoded strings, astral-plane characters such as emoji, and unknown entity names, confirming the encoder and decoder round-trip correctly under every option combination.

How to Use the HTML Entity Encoder/Decoder

  • Open the Encode tab and paste or type your text into the Input Text box. The Encoded Output updates instantly, with no button to press.
  • Tick the encoding options you need: HTML Special Chars for < > & ” and ‘, Non-ASCII Characters for accented letters and symbols, All Special Characters to encode every non-alphanumeric character, or Double Encode to also convert ampersands that are already part of an entity.
  • Pick an Output Format — Named Entities, Decimal Numeric, or Hexadecimal Numeric — and set Hex Case to uppercase or lowercase when using hex.
  • Watch the live stats below the boxes for Characters, Entities, Output Length, and Size Ratio, which shows how much the encoded version grew compared with the original.
  • Switch to the Decode tab and paste entity-encoded text. Toggle Named Entities, Numeric Entities, and Strict Mode to control exactly what gets converted back.
  • Use Swap to move the output into the input box for a round-trip check, then Copy Output or Download .txt to save the result. Clear empties both boxes.
  • Open the Reference tab, filter by category or type in the search field, and click any entity code in the table to copy it.

Example Usage

Input (Encode, named entities): <p class=”note”>Fish & Chips</p>

Output: &lt;p class=&quot;note&quot;&gt;Fish & Chips&lt;/p&gt;

Notice that the ampersand is left alone. That is deliberate: leaving it untouched protects entities that already exist in your text. Tick Double Encode and the same input becomes &lt;p class=&quot;note&quot;&gt;Fish &amp; Chips&lt;/p&gt;, which is what you want when the source is plain text rather than markup.

Input (Encode, hexadecimal, uppercase): Café

Output with Non-ASCII enabled: Caf&#xE9;

Input (Decode): &lt;h1&gt;Caf&eacute; Men&uacute;&lt;/h1&gt;

Output: <h1>Café Menú</h1>

Numeric entities are simply Unicode code points in disguise, so &#xE9; and the hexadecimal byte view of the same character describe the same data in different notations. The Hex to Text Converter is the quickest way to inspect that byte-level representation when you are debugging encoding problems.

Frequently Asked Questions

An HTML entity is a code that represents a character reserved by HTML or difficult to type directly. It starts with an ampersand and ends with a semicolon, such as &lt; for a less-than sign, and the browser renders it as the character instead of treating it as markup.

All three produce the same character. Named entities like &copy; are readable but only exist for a defined set of characters. Decimal entities like &#169; and hexadecimal entities like &#xA9; use the Unicode code point, so they work for any character, including emoji and rare symbols.

Encoding every ampersand would break entities that are already in your text, turning &copy; into &amp;copy;. The tool skips bare ampersands unless you tick Double Encode, which is the correct choice when your input is plain text with no existing entities.

Named entities are easier for humans to read and maintain, so they suit hand-written HTML. Numeric entities are safer for automated pipelines, XML, and legacy systems, because they cover every Unicode character and do not depend on the parser recognizing an entity name.

Escaping the five special characters is an important part of safe output, but it is not a complete defense on its own. Context matters — attributes, URLs, and inline scripts each need their own escaping rules — so treat this tool as a formatting and inspection utility rather than a security control.

Open the Reference tab and search by the character itself, its entity name, its code, or a word from its description. Filter by category such as Currency, Math, Arrows, or Greek, then click the named, decimal, or hex cell to copy that code.

Yes, it’s completely free with no signup required.