EVMTools
). Encoding neutralizes these injections by converting < and > to their entity equivalents."}},{"@type":"Question","name":"What is the difference between named and numeric entities?","acceptedAnswer":{"@type":"Answer","text":"Named entities use descriptive names like & for &, < for <, and © for the copyright symbol. Numeric entities use decimal (&#38;) or hexadecimal (&#x26;) character codes. Both produce the same result, but named entities are more readable."}},{"@type":"Question","name":"When should I use HTML encoding?","acceptedAnswer":{"@type":"Answer","text":"You should encode text when displaying user-generated content on web pages, embedding text in HTML attributes, including special characters in XML/HTML documents, and when storing HTML content in databases or APIs that will later be rendered on web pages."}},{"@type":"Question","name":"What does 'encode all characters' do?","acceptedAnswer":{"@type":"Answer","text":"The 'encode all characters' option converts every character to its numeric HTML entity (e.g., 'A' becomes A). This is useful for obfuscating email addresses to prevent spam bots, or for ensuring all characters are safely encoded regardless of the document's character encoding."}},{"@type":"Question","name":"Is my text stored or sent to a server?","acceptedAnswer":{"@type":"Answer","text":"No. All encoding and decoding happens entirely in your browser using JavaScript. Your text never leaves your device and is not stored, logged, or transmitted anywhere."}}]}

HTML Encoder / Decoder

Encode and decode HTML entities online. Convert special characters to HTML entities for safe display in web pages.

Mode:

Examples

Common HTML Entities Reference

CharacterEntityDecimalDescription
<&lt;&#60;Less than
>&gt;&#62;Greater than
&&amp;&#38;Ampersand
"&quot;&#34;Double quote
'&#39;&#39;Single quote
 &nbsp;&#160;Non-breaking space
©&copy;&#169;Copyright
®&reg;&#174;Registered
&trade;&#8482;Trademark
&euro;&#8364;Euro sign
&mdash;&#8212;Em dash
&ndash;&#8211;En dash

About HTML Encoder / Decoder

HTML encoding converts special characters like <, >, &, and " into their HTML entity equivalents. This is essential for displaying these characters in web pages without the browser interpreting them as HTML tags. It also helps prevent XSS (Cross-Site Scripting) attacks by neutralizing injected HTML and JavaScript.

Decoding reverses this process, converting HTML entities back to their original characters. This tool supports both named entities (like &amp;) and numeric entities (like &#38; and &#x26;).

All processing happens locally in your browser. No data is sent to any server.

How to Use This HTML Encoder / Decoder

This free online HTML encoder and decoder converts between raw text and HTML entities. Use it to safely display special characters in web pages or to decode HTML entities back to readable text:

  1. Choose encode or decode mode using the mode tabs at the top.
  2. Paste or type your text in the input area.
  3. View the result in the output area below. The conversion happens instantly.
  4. Copy the output using the copy button to use in your HTML, JavaScript, or other code.

Enable "Encode all characters" to convert every character to numeric entities, useful for email obfuscation and maximum compatibility.

Common Use Cases

  • XSS prevention — Encode user input before displaying it in HTML to prevent cross-site scripting attacks.
  • Code display — Encode HTML code snippets so they display as text rather than being rendered by the browser.
  • XML/HTML documents — Ensure special characters in content do not break document structure.
  • Email obfuscation — Encode email addresses using numeric entities to hide them from spam bots.
  • API development — Decode HTML entities received from APIs or web scrapers back to readable text.

Related Tools

Frequently Asked Questions

What is HTML encoding?

HTML encoding converts special characters into their HTML entity equivalents so they display correctly in web pages. For example, < becomes &lt;, > becomes &gt;, and & becomes &amp;. Without encoding, the browser would interpret these characters as HTML tags.

Why is HTML encoding important for security?

HTML encoding prevents Cross-Site Scripting (XSS) attacks. If user input is displayed on a web page without encoding, an attacker could inject malicious HTML or JavaScript code (like <script>alert('XSS')</script>). Encoding neutralizes these injections by converting < and > to their entity equivalents.

What is the difference between named and numeric entities?

Named entities use descriptive names like &amp; for &, &lt; for <, and &copy; for the copyright symbol. Numeric entities use decimal (&amp;#38;) or hexadecimal (&amp;#x26;) character codes. Both produce the same result, but named entities are more readable.

When should I use HTML encoding?

You should encode text when displaying user-generated content on web pages, embedding text in HTML attributes, including special characters in XML/HTML documents, and when storing HTML content in databases or APIs that will later be rendered on web pages.

What does 'encode all characters' do?

The 'encode all characters' option converts every character to its numeric HTML entity (e.g., 'A' becomes &#65;). This is useful for obfuscating email addresses to prevent spam bots, or for ensuring all characters are safely encoded regardless of the document's character encoding.

Is my text stored or sent to a server?

No. All encoding and decoding happens entirely in your browser using JavaScript. Your text never leaves your device and is not stored, logged, or transmitted anywhere.