HTML Encoder / Decoder

When you want a web page to display characters like <, > or & as visible text instead of interpreting them as code, you must encode them as HTML entities such as < and &. Forget once, and your code sample breaks the page layout or vanishes entirely. Our free HTML encoder and decoder converts in both directions: encode text so it is safe to paste into HTML, templates and CMS editors, or decode entity-filled text copied from source code back into normal readable characters.

Quick Answer: Paste text and click Encode to turn special characters into HTML entities (<, >, &, quotes), or Decode to convert entities back into plain readable text.

Free Online Tool

HTML Encoder / Decoder

Make text safe for HTML, or turn entities back into readable text.





How to Use the HTML Encoder / Decoder

  1. Paste the text or code snippet into the box.
  2. Click Encode if you plan to place the text inside HTML and need it displayed literally.
  3. Click Decode if you copied text full of entities like & or ' and want it readable again.
  4. Choose whether to also encode quotes, which matters when text goes inside an HTML attribute value.
  5. Copy the converted output into your page, template or document.

Key Features

  • Encodes the full core set: ampersand, angle brackets, quotes and apostrophes.
  • Optional numeric encoding for extended characters beyond the basic set.
  • Decodes both named entities (©) and numeric entities (© and ©).
  • Round-trip safe: encode then decode returns your exact original text.
  • Runs locally, so the code snippets and content you clean never leave your device.

Best Practices and Tips

  • Encode text before embedding user-generated content in a page; it is a first line of defence against broken markup and script injection.
  • Inside attribute values delimited by double quotes, always encode quotes as well, or a single stray quote ends the attribute early.
  • When a CMS shows raw entities like & to your readers, the text was probably double-encoded; decode once here and re-paste.
  • Keep a decoded copy of code samples for editing and an encoded copy for publishing, so you never edit the entity version by hand.

Common Mistakes to Avoid

  • Encoding text that is then placed inside a script or style block, where HTML entities are not parsed and will appear literally.
  • Decoding content and pasting it straight into a page without re-encoding, reintroducing the broken markup you were fixing.
  • Assuming accented characters must always be entities; with a UTF-8 charset declared, they can be used directly and safely.

Frequently Asked Questions

What is an HTML entity?

An HTML entity is a code that represents a character inside HTML, starting with an ampersand and ending with a semicolon. Entities exist for characters that have special meaning in HTML (< for <), and for symbols that are hard to type (© for ©).

Which characters must always be encoded?

In ordinary text content, encode & and < at minimum; > is commonly encoded too. Inside attribute values, also encode the quote character that delimits the attribute. This tool covers all of these.

Why does my text show &amp; on the page?

That is double encoding: the text was encoded twice, so the ampersand of the first entity itself became an entity. Decode the text once (here, or in your CMS) to return to a single, correct encoding.

Does encoding affect SEO or readability?

Search engines read entities as the characters they represent, so correctly encoded text ranks and reads identically. Broken, unencoded markup is the real risk, because it can hide content from crawlers and visitors alike.

Can I decode entities from a whole web page?

You can paste the page’s text content here, but do not decode an entire HTML document: its tags are supposed to be code. Decode only the text portions you intend to read or repurpose.

Related Tools