HomeToolsHTML Entity Encoder/Decoder

HTML Entity Encoder/Decoder

Encode and decode HTML entities including named and numeric formats. Convert special characters for safe HTML display with a handy entity reference table.

Encode/decode HTML entitiesNamed entitiesNumeric entitiesBulk conversionCommon entity referenceCopy to clipboard
Entity format:

Text to Encode

HTML Entities

Common HTML Entities Reference

CharacterDescriptionNamedNumeric
<Less than&lt;&#60;
>Greater than&gt;&#62;
&Ampersand&amp;&#38;
"Double quote&quot;&#34;
'Single quote&apos;&#39;
(space)Non-breaking space&nbsp;&#160;
©Copyright&copy;&#169;
®Registered&reg;&#174;
Trademark&trade;&#8482;
Euro sign&euro;&#8364;
£Pound sign&pound;&#163;
En dash&ndash;&#8211;
Em dash&mdash;&#8212;
Bullet&bull;&#8226;
Ellipsis&hellip;&#8230;
Left arrow&larr;&#8592;
Right arrow&rarr;&#8594;

About HTML Entity Encoding

HTML entity encoding converts special characters into their HTML entity equivalents, preventing them from being interpreted as HTML markup. This is essential for displaying characters like <, >, and & in web pages.

  • Named entities use readable names like &amp; for &
  • Numeric entities use character codes like &#38; for &
  • Encoding prevents XSS (Cross-Site Scripting) attacks in web applications
  • All processing happens client-side — your data never leaves your browser

How to Use the HTML Entity Encoder/Decoder

  1. 1Choose between Encode mode to convert characters to HTML entities or Decode mode to convert entities back
  2. 2Paste or type your text into the input area on the left
  3. 3For encoding, select Named entities (&amp;) or Numeric (&#38;) format
  4. 4Optionally enable "Encode all non-ASCII characters" to convert accented letters, symbols, and emoji
  5. 5View the result in the output panel and click "Copy Result" to copy
  6. 6Use the Swap button to quickly reverse the operation with your current output

Frequently Asked Questions

What are HTML entities and why do I need to encode them?

HTML entities are special sequences that represent characters which have meaning in HTML markup, such as < (less than), > (greater than), and & (ampersand). Encoding them prevents browsers from interpreting them as HTML tags or syntax, and also protects against XSS (Cross-Site Scripting) attacks.

What is the difference between named and numeric HTML entities?

Named entities use human-readable names like &amp; for & and &lt; for <. Numeric entities use the Unicode code point like &#38; for & and &#60; for <. Named entities are easier to read, but numeric entities can represent any Unicode character, even those without a named entity.

Which characters must always be encoded in HTML?

The five characters that must always be encoded in HTML content are: & (ampersand), < (less than), > (greater than), " (double quote, inside attributes), and ' (single quote/apostrophe, inside attributes). Failing to encode these can break your HTML or create security vulnerabilities.

Can I use this tool for escaping HTML in code?

Yes! This tool is perfect for escaping HTML snippets that you want to display as text on a web page, in blog posts, documentation, or code examples. Simply paste your HTML code in Encode mode and the output will be safe to embed in any HTML document.

Is my data secure when using this tool?

Absolutely. All encoding and decoding happens entirely in your browser using client-side JavaScript. Your text is never sent to any server, ensuring complete privacy and security for sensitive content.

Need More Developer Tools?

Explore our complete collection of free online developer utilities

View All Tools