HTML Encoder/Decoder

Escape special characters as HTML entities, or decode entities back to plain text.

How to Use HTML Encoder/Decoder

  1. Choose HTML Encode or HTML Decode.
  2. Type or paste your text. The result updates as you type.
  3. Copy the result, or press Swap to send it back through the other way.

What encoding changes

Encoding replaces the five characters that have a meaning in HTML: & becomes &amp;, < becomes &lt;, > becomes &gt;, a double quote becomes &quot; and an apostrophe becomes &#039;. Everything else, including accented letters and emoji, is left alone, which is fine on any page saved as UTF-8.

Decoding works the other way and understands every named entity (&nbsp;, &copy;, &eacute;) as well as numeric ones in decimal (&#8377;) or hex (&#x20B9;). Real tags in the text, like <b>, are kept as they are; only the entities are turned back into characters.

Escaping is not the same as sanitizing

Encoding is the right way to place untrusted text between tags or inside a quoted attribute. It does not make text safe everywhere: inside a <script> block, in an unquoted attribute or in a link's href (where javascript: URLs are a risk) you need different handling. If you are building a site, let your framework or template engine do the escaping and use this tool for checking and one-off jobs.

Key Features & Practical Use Cases

  • Showing a code snippet in a blog post or forum without the browser running it as HTML.
  • Putting text that contains quotes into an HTML attribute safely.
  • Reading text from a CMS, RSS feed or API that arrives full of &amp; and &#39;.
  • Checking what an entity such as &rarr; or &#x20B9; stands for.

Frequently Asked Questions

What is an HTML entity?

A code that stands for a character, such as &lt; for < or &copy; for ©. Browsers show the character instead of the code.

Why does &nbsp; matter?

It's a non-breaking space. It looks like a normal space but stops a line from wrapping there, and it's a common reason copied text behaves oddly.

Does encoding convert accented letters too?

No. Only & < > " and ' are changed. Accented letters and emoji display correctly on UTF-8 pages, which is nearly every site today.

Is my text uploaded?

No. Encoding and decoding happen in your browser.

About OneClickly

OneClickly is a set of 119 free tools for PDFs, images, text, everyday math and code. They run in your browser, so the files and text you work with stay on your device.

Related Tools

  • JWT Decoder - Read the header, payload and expiry of a JSON Web Token in your browser.
  • Hash Generator - Get MD5, SHA-1, SHA-256 and SHA-512 hashes of any text as you type.
  • Bcrypt Hash Generator - Create bcrypt password hashes and check a password against an existing hash.
  • JWT Generator - Create HS256 signed JSON Web Tokens for testing, with your own payload and secret.
  • Base64 Encoder/Decoder - Encode text to Base64 or decode it back, with UTF-8 and URL-safe support.
  • URL Encoder/Decoder - Encode special characters in URLs (percent-encoding) or decode them.