HTML Entity Encoder & Decoder

Encode and decode HTML entities instantly in your browser. Supports named entities (&, <, >, ©, € and more) and numeric entities (<, <). Free, fast, 100% client-side — no data uploaded.

Did we solve your problem today?

What Are HTML Entities?

HTML entities are special character sequences that represent characters with reserved meaning in HTML or characters that cannot be typed directly on a standard keyboard. Every entity starts with an ampersand (&) and ends with a semicolon (;).

The five characters that must always be encoded in HTML are:

CharacterEntityReason
&&Starts an entity reference
<&lt;Opens an HTML tag
>&gt;Closes an HTML tag
"&quot;Delimits attribute values
'&#39;Delimits attribute values (single-quoted)

Failing to encode these characters in user-generated content is the root cause of XSS (cross-site scripting) vulnerabilities — one of the most common security issues on the web.

Named vs. Numeric Entities

HTML supports two types of entities:

Named entities use a human-readable name like &copy;, &euro;, or &hellip;. They are defined in the HTML specification and are supported by all modern browsers.

Numeric entities use the Unicode code point of the character, either in decimal (&#169;) or hexadecimal (&#xA9;). Numeric entities work for any Unicode character, even those without a defined name. Both forms render identically:

CharacterNamedDecimalHex
<&lt;&#60;&#x3C;
©&copy;&#169;&#xA9;
&euro;&#8364;&#x20AC;
&mdash;&#8212;&#x2014;

When Do You Need HTML Encoding?

Any time you insert untrusted or dynamic content into HTML, you must encode it first. Common situations:

The &nbsp; Entity

&nbsp; (non-breaking space, &#160;) is a special entity that behaves like a space but:

Use &nbsp; between a number and its unit (10&nbsp;kg), in table cells that need to appear non-empty, and wherever a forced space is needed.

How to Use the HTML Entity Encoder

  1. Paste your plain text or HTML-encoded text into the input box.
  2. Click Encode HTML to convert <, >, &, ", and ' to safe entities.
  3. Click Decode HTML to convert entities back to their original characters.
  4. Click Copy to copy the result to your clipboard.

The encoder updates live as you type, so you can see results instantly.

All to Numeric Mode

The All to Numeric tab converts every special character — including non-ASCII characters like accented letters, emoji, and symbols — to decimal numeric entities (&#code;). This produces 100% ASCII-safe output that works in any context, including older email clients and XML documents.

For example, Héllo € becomes H&#233;llo &#8364;.

Privacy

All encoding and decoding runs entirely in your browser. This tool uses only built-in JavaScript string operations — no external libraries, no server calls. Your data never leaves your device.

Common HTML Entity Quick Reference

The Reference tab above lists 25 frequently used HTML entities with their character, named form, numeric form, and description — useful as a quick lookup while working on HTML templates or email code.

FAQ

What are HTML entities?

HTML entities are special character sequences used to represent characters that have special meaning in HTML (like &lt; and &gt;) or that cannot be typed directly. They start with an ampersand (&) and end with a semicolon (;). For example, &amp;lt; renders as < and &amp;copy; renders as ©.

When do I need to encode HTML entities?

You need HTML encoding whenever you display user-generated content, code snippets, or special characters inside HTML. Without encoding, characters like <, >, and & break your HTML structure and can cause XSS (cross-site scripting) vulnerabilities. Always encode untrusted input before inserting it into HTML.

What is the difference between named and numeric entities?

Named entities use a readable name: &amp;lt; for <, &amp;copy; for ©. Numeric entities use the Unicode code point in decimal (&amp;#60;) or hexadecimal (&amp;#x3C;). Both render identically in browsers. Named entities are easier to read; numeric entities work for any Unicode character even if no name exists.

Is my data sent to a server?

No. All encoding and decoding runs locally in your browser using pure JavaScript string operations. Your text never leaves your device and is never stored or shared.

What is &amp;nbsp;?

&amp;nbsp; is the non-breaking space entity. Unlike a regular space, it prevents a line break at its position and is always exactly one space wide. It is commonly used to add horizontal spacing in HTML without collapsing and to keep words or values together on the same line.