Free HTML Entity Encoder

Encode special characters to HTML entities and vice versa. Free, fast, and works entirely in your browser with no sign-up required.

Updated

Share:
Home/Code Tools/HTML Entity Encoder/Decoder

HTML Entity Encoder/Decoder

Encode special characters to HTML entities or decode entities back. Supports named, numeric, and hex entities with auto-detection, bulk processing, and live preview.

Encoding Options

Input

0 chars
1

Output

0 entities
0 chars
1

HTML Entity Reference

CharNamedDecimalHexDescriptionActions
&&&&Ampersand
<&lt;&#60;&#x3C;Less than
>&gt;&#62;&#x3E;Greater than
"&quot;&#34;&#x22;Double quote
'&#39;&#x27;Single quote / Apostrophe
 &nbsp;&#160;&#xA0;Non-breaking space
©&copy;&#169;&#xA9;Copyright
®&reg;&#174;&#xAE;Registered trademark
&trade;&#8482;&#x2122;Trademark
&euro;&#8364;&#x20AC;Euro sign
£&pound;&#163;&#xA3;Pound sign
¥&yen;&#165;&#xA5;Yen sign
¢&cent;&#162;&#xA2;Cent sign
¤&curren;&#164;&#xA4;Currency sign
°&deg;&#176;&#xB0;Degree sign
±&plusmn;&#177;&#xB1;Plus-minus
×&times;&#215;&#xD7;Multiplication
÷&divide;&#247;&#xF7;Division
&ne;&#8800;&#x2260;Not equal
&le;&#8804;&#x2264;Less than or equal
&ge;&#8805;&#x2265;Greater than or equal
¼&frac14;&#188;&#xBC;One quarter
½&frac12;&#189;&#xBD;One half
¾&frac34;&#190;&#xBE;Three quarters
&radic;&#8730;&#x221A;Square root
&infin;&#8734;&#x221E;Infinity
§&sect;&#167;&#xA7;Section sign
&para;&#182;&#xB6;Paragraph
&bull;&#8226;&#x2022;Bullet
&hellip;&#8230;&#x2026;Horizontal ellipsis
&ndash;&#8211;&#x2013;En dash
&mdash;&#8212;&#x2014;Em dash
&lsquo;&#8216;&#x2018;Left single quote
&rsquo;&#8217;&#x2019;Right single quote
&ldquo;&#8220;&#x201C;Left double quote
&rdquo;&#8221;&#x201D;Right double quote
«&laquo;&#171;&#xAB;Left guillemet
»&raquo;&#187;&#xBB;Right guillemet
&larr;&#8592;&#x2190;Left arrow
&rarr;&#8594;&#x2192;Right arrow
&uarr;&#8593;&#x2191;Up arrow
&darr;&#8595;&#x2193;Down arrow
&harr;&#8596;&#x2194;Left-right arrow
&crarr;&#8629;&#x21B5;Carriage return
&spades;&#9824;&#x2660;Black spade
&clubs;&#9827;&#x2663;Black club
&hearts;&#9829;&#x2665;Black heart
&diams;&#9830;&#x2666;Black diamond
À&Agrave;&#192;&#xC0;A with grave
Á&Aacute;&#193;&#xC1;A with acute

Showing 50 of 58 entities

About HTML Entity Encoder

HTML entities are special codes used to represent characters that have special meaning in HTML or characters that cannot be typed on a keyboard. Conversion happens in real-time as you type.

Entity Formats:

  • Named: Uses readable names like &amp;, &lt;, &copy;
  • Decimal: Uses Unicode code points like &#38;, &#60;
  • Hex: Uses hexadecimal code points like &#x26;, &#x3C;

Selective Encoding Modes:

  • Special Only: Encodes only HTML-significant chars (& < > " ')
  • Non-ASCII: Also encodes characters with code points above 127
  • All Symbols: Encodes all non-alphanumeric characters
  • Custom: Specify exactly which additional characters to encode

Features:

  • Auto-detection of encode/decode mode from pasted content
  • Bulk processing for multiple strings (one per line)
  • Live HTML preview showing rendered output
  • Operation history saved to localStorage
  • Code snippets in HTML, JavaScript, PHP, and Python

Privacy First: All encoding/decoding happens locally in your browser. No data is sent to any server.

Frequently Asked Questions

What is the HTML Entity Encoder?

The HTML Entity Encoder is a free online tool that converts special characters to their HTML entity equivalents and decodes entities back to characters.

Is the HTML Entity Encoder free?

Yes, it is completely free with no registration required. All encoding happens client-side in your browser.

Why do I need HTML entities?

HTML entities prevent special characters like <, >, and & from being interpreted as HTML code, ensuring they display correctly on web pages.

Is my data safe with this tool?

Absolutely. The HTML Entity Encoder processes everything client-side in your browser. No data is uploaded to or stored on any server. Your content remains private on your device at all times.

Does the HTML Entity Encoder work on mobile devices?

Yes, the HTML Entity Encoder is fully responsive and works on smartphones and tablets. You can use it on any device with a modern web browser -- no app download required.

Do I need to create an account to use this tool?

No account or registration is needed. Simply open the HTML Entity Encoder in your browser and start using it immediately. There are no sign-up walls or usage restrictions.

How do I use the HTML Entity Encoder?

Simply enter your input in the provided field, adjust any settings to your preference, and the tool will process it instantly. You can then copy the result to your clipboard or download it.

Which browsers are supported?

The HTML Entity Encoder works in all modern browsers including Chrome, Firefox, Safari, Edge, and Opera. For the best experience, use the latest version of your preferred browser.

What is the difference between named, decimal, and hexadecimal HTML entities?

All three are different ways to write the same character, and browsers render them identically. A named entity uses a readable keyword, like &amp; for the ampersand or &copy; for the copyright sign. A decimal (numeric) entity uses the character's Unicode code point in base 10, so the ampersand becomes &#38;. A hexadecimal entity uses that same code point in base 16, written as &#x26;. Named entities are the easiest to read and maintain, but only a limited set of characters have one; decimal and hex work for any character, which makes them safer for unusual symbols. This encoder lets you switch between all three formats with one click, and when a character has no named entity it automatically falls back to a numeric code so your output stays valid.

Which characters must be escaped as HTML entities?

Five characters carry special meaning in HTML and should be escaped so the browser treats them as text rather than markup: the ampersand (&amp;), the less-than sign (&lt;), the greater-than sign (&gt;), the double quote (&quot;), and the single quote or apostrophe (&#39;). The ampersand must come first when encoding by hand, because it begins every entity itself. Escaping these matters most when you insert user-supplied or dynamic content into a page: an unescaped < can prematurely open a tag, a stray & can break a URL parameter, and unescaped quotes can break out of an attribute value. The encoder's "Special Only" mode targets exactly this set, leaving the rest of your text untouched so the output stays readable. Paste your markup and pick that mode to escape only what HTML actually requires.

How do I decode HTML entities back into normal text?

Decoding reverses entity codes into the characters they represent, turning &lt;div&gt; back into <div> or &amp;copy; back into the copyright sign. Switch the tool to Decode mode, or simply paste entity-laden text and it auto-detects the direction for you when it sees patterns like &name; or &#26;. The decoder recognizes all three formats in a single pass: named entities such as &mdash;, decimal entities such as &#8212;, and hexadecimal entities such as &#x2014;, even when they are mixed together in the same block. This is useful for reading raw HTML pulled from an API, cleaning up data exported from a CMS, or checking what an encoded string actually says. Paste your encoded text, and the readable result appears instantly in the panel beside it, ready to copy.

When should I encode non-ASCII characters like accented letters and currency symbols?

Modern pages declared as UTF-8 can display characters like e-acute, the euro sign, or em dashes directly, so escaping every accented letter is usually unnecessary. Encoding non-ASCII characters becomes worthwhile when you cannot guarantee the encoding of the destination, such as older email templates, systems that may strip or mangle UTF-8, or files that must stay strictly ASCII-safe for transport. Converting those characters to entities makes the output portable regardless of how the receiving system handles bytes above code point 127. This tool's "Non-ASCII" mode encodes the required HTML characters plus everything above 127, while "All Symbols" goes further and escapes every non-alphanumeric character. For full control, "Custom" mode lets you name the exact extra characters to escape. Pick the mode that matches your target environment, then copy the portable result.

Why does my text grow larger after encoding to HTML entities?

A single character can expand into several characters once it becomes an entity. The less-than sign is one byte but turns into &lt;, which is four characters, and a copyright sign encoded as a decimal entity like &#169; takes five. The more special or non-ASCII characters your text contains, the larger the encoded output grows, so heavily symbolic or accented content sees the biggest increase while plain alphanumeric text barely changes. This is normal and expected: encoding trades a little size for guaranteed correct, safe rendering. Named entities are often shorter than the numeric equivalents, so choosing the named format can keep output more compact when a name exists. The statistics panel here reports input and output size in bytes and the exact percentage change, so you can see the cost of each format and selective mode before you copy.

Embed This Tool

Add a free, live version of this widget to your own website or blog post — it runs entirely in your visitors' browsers, with a credit link back to The Toolbox.

Copy & paste this HTML
<iframe src="https://getthetoolbox.com/embed/html-entity-encoder" title="Free HTML Entity Encoder — The Toolbox" width="100%" height="260" style="max-width:480px;border:1px solid #e2e8f0;border-radius:12px" loading="lazy"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://getthetoolbox.com/code-tools/html-entity-encoder?utm_source=embed&utm_medium=widget" target="_blank" rel="noopener">Free HTML Entity Encoder</a> by The Toolbox</p>

About the HTML Entity Encoder

The HTML Entity Encoder is a free online tool that converts special characters into their HTML entity equivalents and decodes entities back into plain text. Paste markup or text into the input box and the result appears instantly in the panel beside it. It is built for front-end developers, technical writers, email and CMS editors, and anyone who needs to make sure characters like <, >, &, and " display as literal text on a web page instead of being parsed as code.

Everything runs locally in your browser. Your input is never uploaded to a server, so it stays private even when you paste production markup, customer data, or an unpublished template. There is no sign-up, no character cap, and nothing to install. The tool even keeps a short operation history in your browser's local storage so you can reload recent conversions, and that history never leaves your device.

What an HTML entity is and why encoding matters

An HTML entity is a code that stands in for a character the browser would otherwise treat specially. The five characters that must be escaped in HTML are the ampersand (&amp;), less-than (&lt;), greater-than (&gt;), double quote (&quot;), and single quote (&#39;). Without encoding, a stray < can prematurely open a tag, an unescaped & can break a URL parameter, and user-supplied <script> can become a cross-site scripting hole. Encoding turns those characters into inert text so they render exactly as typed.

Entities also let you display symbols that are hard to type or that vary by font and keyboard layout — the copyright sign, em dashes, accented Latin letters, currency symbols like the euro and pound, and math signs such as plus-minus or "not equal." The encoder ships with a searchable reference of more than 50 common characters covering punctuation, symbols, currency, math, arrows, and accented Latin letters; you can filter by category or search by character, name, or code point, then copy or insert any entity directly.

Encoding formats and selective modes

The encoder produces three interchangeable entity formats, all of which browsers render identically:

  • Named — readable names such as &amp;, &lt;, and &copy;. When no named entity exists for a character, the tool falls back to a numeric code.
  • Decimal (numeric) — the Unicode code point in base 10, for example &#38; for the ampersand.
  • Hexadecimal — the same code point in base 16, for example &#x26;.

You also control which characters get encoded. "Special Only" touches just the HTML-significant set; "Non-ASCII" additionally encodes any character above code point 127, which is handy for guaranteeing ASCII-safe output; "All Symbols" encodes every non-alphanumeric character; and "Custom" lets you name the exact extra characters to escape. The decoder works the other way, automatically recognizing named, decimal, and hex entities in one pass.

How to use it

Choose Encode or Decode — or just paste, since the tool auto-detects which direction you need when it sees entity patterns in your input. Pick a format and selective mode, and the output updates in real time. A statistics panel reports the input and output size in bytes, the percentage size change from encoding, and a breakdown of how many named, decimal, and hex entities were produced. From there you can copy the result, download it as a .txt or .html file, swap the input and output to round-trip a conversion, or open the Live Preview to compare the raw encoded source against how a browser actually renders it.

For repetitive work, Bulk Mode processes one string per line at once, you can upload a .txt or .html file instead of pasting, and the built-in Code Snippets tab shows equivalent encode and decode logic in HTML, JavaScript, PHP, and Python so you can move the same operation into your own codebase.