Toolmingo

HTML Encode / Decode

Encode text into HTML entities or decode HTML entities back to text. Great for safely displaying code. Free and in-browser.

Plain text
HTML entities

How to use the HTML Encode / Decode

  1. 1Paste or type your text into the input box — raw HTML/code if you want to encode it, or entity-laden text like <p> if you want to decode it.
  2. 2Choose the direction: click Encode to convert characters into HTML entities, or Decode to turn entities back into plain readable characters.
  3. 3Optionally pick an encoding scope — minimal (only < > & ") for safe display, or full to also escape non-ASCII characters like accented letters and symbols.
  4. 4Read the converted result in the output panel; it updates instantly in your browser with no upload.
  5. 5Click Copy to put the result on your clipboard, or Download to save it as a .txt file for pasting into your code editor or CMS.
  6. 6To reverse a result, swap the output back into the input and run the opposite operation, useful for spotting double-encoded strings.

About the HTML Encode / Decode

HTML Encode Decode converts plain text into HTML entities and turns HTML entities back into readable characters. When you encode, characters that have special meaning in markup — the angle brackets < and >, the ampersand &, and the double quote " — become their entity equivalents (&lt;, &gt;, &amp;, &quot;). Decoding reverses the process, resolving both named entities like &copy; and numeric references like &#169; or &#x00A9; back into the original character. Everything happens inside your browser using the DOM and JavaScript string methods; nothing you paste is ever uploaded, logged, or sent to a server, so it is safe to run on proprietary snippets or internal templates.

The most common reason people reach for this is to display code as text on a web page. If you want a tutorial to literally show <div class="box">, you must write &lt;div class="box"&gt;, otherwise the browser renders the div instead of printing it. Encoding does that conversion instantly for whole blocks. Developers also use it to sanitize user-generated strings before injecting them into HTML, preventing a stray < from breaking the layout or opening an XSS hole. On the decoding side, it is handy when an API, RSS feed, database export, or scraped page returns text riddled with &amp;amp; or &#39; and you need clean, human-readable content back.

Front-end and back-end developers, technical writers, CMS editors, email-template builders, and QA testers all benefit. A practical tip: encoding is not the same as URL encoding (%20) or Base64 — use this only for HTML contexts. Another: watch for double-encoding, where &amp;amp; means an ampersand was encoded twice; decode once to check. If you only need the four markup-critical characters escaped, a minimal-encode option keeps accented letters like é readable instead of turning them into &eacute;. Because the tool is client-side, it works offline once the page is loaded and handles large pastes without a round trip. Copy the result with one click or download it as a text file for pasting into your editor.

Frequently asked questions

Which characters actually get encoded?

A minimal encode escapes the five characters that matter in markup: < becomes &lt;, > becomes &gt;, & becomes &amp;, " becomes &quot;, and ' becomes &#39;. A full encode additionally converts non-ASCII characters — accented letters, em dashes, emoji — into numeric entities so the text survives ASCII-only pipelines. For displaying code, minimal is usually all you need.

What is the difference between HTML encoding and URL encoding?

They solve different problems. HTML encoding protects characters that would otherwise be interpreted as markup by a browser (turning < into &lt;). URL encoding protects characters that are unsafe in a web address (turning a space into %20). If you paste a URL query string here expecting %20, you're using the wrong tool — this handles HTML entities only.

Why does my decoded text still show &amp; or &amp;amp;?

That's double-encoding: the source was run through an encoder more than once, so an ampersand became &amp;amp;. Decode a second time and it resolves to a single &. It's a common symptom when a value passes through several systems that each escape it. Decode repeatedly until the output stops changing.

Does it handle numeric entities like &#169; and hex like &#x00A9;?

Yes. Decoding recognizes named entities (&copy;), decimal numeric references (&#169;), and hexadecimal references (&#x00A9;), all of which resolve to the copyright symbol ©. It leverages the browser's own entity table, so even obscure named entities decode correctly.

Is it safe to paste confidential code or internal templates?

Yes. All encoding and decoding runs locally in your browser via JavaScript — your text never leaves the page and is never sent to or stored on any server. You can even disconnect from the internet after the page loads and it keeps working, which makes it suitable for proprietary snippets and internal markup.

Related tools

Browse all free online tools in Text tools and more.

Frequently asked questions

What does it escape?+

Characters like < > & " ' are converted to and from their HTML entities.

Related tools