Logo

MonoCalc

/

HTML Entity Converter

Encode/Decode

Input

0 chars

Output

0 chars

About This Tool

🏷️ HTML Entity Converter – Encode & Decode

The HTML Entity Converter is a bidirectional tool that transforms plain text into HTML entity equivalents and converts HTML entities back to their original characters. Whether you need to safely embed user content in an HTML page, protect against XSS (cross-site scripting), or decode entities copied from a web page source, this converter handles it instantly in your browser — no data is sent to any server.

What Are HTML Entities?

HTML reserves certain characters for its own syntax — primarily <, >, &, ", and '. When these appear inside HTML content or attributes, the browser interprets them as markup rather than literal text. An HTML entity is an escaped representation that tells the browser to display the character without processing it as HTML. For example, < renders as < in the browser.

Three Entity Formats

HTML supports three equivalent notations for any character:

FormatSyntaxExample for <When to Use
Named&name;&lt;Human-readable, most common
Decimal&#NNN;&#60;Any Unicode character, numeric
Hexadecimal&#xHH;&#x3C;Unicode code points, compact

When a character has no official named entity (such as most emoji or uncommon symbols), the tool automatically falls back to the decimal or hexadecimal form depending on your selected format.

Encode Scopes Explained

HTML-Unsafe Only (default)

Encodes only the five structurally significant characters: < > & " '. This is the minimum required to safely embed text inside an HTML document without breaking markup or enabling injection attacks.

Non-ASCII + HTML-Unsafe

Also converts accented letters, symbols, currency signs, arrows, and any character outside the US-ASCII range (code points > 127). Use this for maximum compatibility with older HTML parsers or ASCII-only transmission channels.

All Characters

Encodes every character in the input — including plain ASCII letters and digits. Produces a fully obfuscated, ASCII-safe output. Useful for email harvesting protection, educational demonstrations, or debugging encoding pipelines.

Common HTML Entities Reference

CharacterNamedDecimalHexDescription
<&lt;&#60;&#x3C;Less-than sign
>&gt;&#62;&#x3E;Greater-than sign
&&amp;&#38;&#x26;Ampersand
"&quot;&#34;&#x22;Double quotation mark
'&apos;&#39;&#x27;Apostrophe
©&copy;&#169;&#xA9;Copyright sign
®&reg;&#174;&#xAE;Registered sign
&trade;&#8482;&#x2122;Trade mark sign
&euro;&#8364;&#x20AC;Euro sign
&mdash;&#8212;&#x2014;Em dash
&hellip;&#8230;&#x2026;Ellipsis
&rarr;&#8594;&#x2192;Rightwards arrow

Decode Mode

In Decode mode the tool recognises and converts all three entity formats simultaneously — you can paste any mix of named, decimal, and hex entities and the tool will produce the correct original text. Malformed or unrecognised entities (e.g., &unknown; or &#xGHI;) are left unchanged and reported in the warnings panel, so you can spot problems quickly.

Security and XSS Prevention

Cross-site scripting (XSS) is one of the most common web vulnerabilities. It occurs when an attacker injects malicious HTML or JavaScript into a page by exploiting unencoded user input. Encoding <, >, &, ", and ' before rendering user-supplied content in HTML is the fundamental defence. Use this tool to verify your encoding logic or to quickly produce safe HTML snippets for templates, emails, and documentation.

Tips for Developers

  • Use HTML-Unsafe Only scope for the most readable output while still protecting against injection — don't over-encode unless necessary.
  • The Swap button lets you round-trip your data: encode it, then swap and decode to verify the original text is recovered correctly.
  • Hex format is useful when working with code-point–aware tools or when the decimal form would be ambiguous (e.g., in CSS content values).
  • For emoji and characters above U+FFFF, the tool emits a single entity (e.g., &#x1F389;) rather than surrogate pairs — this is correct for HTML5.
  • Always complement client-side encoding with a server-side sanitisation library in production applications.

Frequently Asked Questions

Is the HTML Entity Converter free?

Yes, HTML Entity Converter is totally free :)

Can I use the HTML Entity Converter offline?

Yes, you can install the webapp as PWA.

Is it safe to use HTML Entity Converter?

Yes, any data related to HTML Entity Converter only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

What is an HTML entity?

An HTML entity is a special sequence of characters used to represent reserved or special characters in HTML. For example, the less-than sign (<) is written as &lt; to prevent the browser from interpreting it as an HTML tag. Entities can be named (&amp;), decimal (&#38;), or hexadecimal (&#x26;).

How does the HTML Entity Converter work?

Paste your text into the input panel, choose Encode or Decode, select the entity format and scope, then click Convert. The tool processes every character in your text according to your settings and displays the result instantly. The conversion summary table shows exactly which characters were transformed. All processing happens in your browser.

What is the difference between Named, Decimal, and Hexadecimal entities?

Named entities use a human-readable name (e.g., &lt; for <). Decimal entities use the Unicode code point as a number (e.g., &#60; for <). Hexadecimal entities use the code point in hex (e.g., &#x3C; for <). Named entities are more readable, while decimal and hex entities work for any Unicode character even when no named form exists.

What encode scope should I use?

Use 'HTML-Unsafe Only' for embedding plain text safely inside HTML — it encodes only the five critical characters (<, >, &, ", '). Choose 'Non-ASCII Only' to also encode accented letters, symbols, and characters outside the ASCII range. Select 'All Characters' for full obfuscation or to produce ASCII-only output from any Unicode input.

Can it decode any mix of named, decimal, and hex entities?

Yes. In Decode mode the tool recognises and converts all three entity formats simultaneously, regardless of how they are mixed in the input. Malformed or unrecognised entities are left unchanged and flagged in the summary table.

Is it safe to use this tool to prevent XSS?

Encoding HTML-unsafe characters (&, <, >, ", ') is the primary defence against HTML injection and cross-site scripting (XSS) when inserting user-supplied content into an HTML page. This tool performs that encoding correctly. However, for production security always use a dedicated server-side library — never rely solely on client-side encoding.