Online HTML Encoder and Decoder

Escape and unescape HTML safely. Convert special characters to entities to prevent markup parsing, or decode entities back to readable text. Perfect for templates, snippets, docs, and quick web debugging.

HTML Encode / Decode

About HTML Encoding

HTML encoding replaces special characters with HTML entities so they are treated as plain text instead of markup. This prevents broken layouts, avoids accidental tag parsing, and helps protect literal content such as code snippets, quotes, or user input. πŸ›‘️🧩

What you can do

  • Encode raw text or HTML so it can be safely displayed inside a page.
  • Decode HTML entities back into human-readable characters.
  • Preview & copy escaped output for use in templates, CMSs, or documentation.

How it works

  • Encode escapes the five core HTML characters: & β†’ &amp;, < β†’ &lt;, > β†’ &gt;, " β†’ &quot;, ' β†’ &apos;. Other characters are left untouched for readability.
  • Decode resolves named and numeric entities back into characters using the browser's HTML parser.

HTML entity quick reference

Character Entity Why it matters
& &amp; Starts all entities
< &lt; Prevents tag injection
> &gt; Closes HTML tags
" &quot; Protects attribute values
' &apos; Useful in single-quoted attributes

Buttons

  • Encode Β»: Convert the left textarea into escaped HTML and show it on the right.
  • Decode Β»: Convert entities on the left back to readable characters.
  • Β« Swap Β»: Swap left/right fields to continue converting in the opposite direction.
  • Copy Result πŸ“‹: Copy the right texarea to the clipboard.
  • Erase: Clear both fields.
  • Demo: Fill the input with a short example you can try immediately.

How to use

  1. Paste raw text (or HTML with entities) into the Input field.
  2. Click Encode to escape or Decode to unescape.
  3. Use Swap to move results back to the input for another round.
  4. Click Copy Result when you're ready to paste elsewhere.

Examples

  • Input: <div class="greet">Tom & Jerry</div>
    Encode β†’ &lt;div class=&quot;greet&quot;&gt;Tom &amp; Jerry&lt;/div&gt;
  • Input: &lt;span&gt;5 &amp; 7&lt;/span&gt;
    Decode β†’ <span>5 & 7</span>

Tips & best practices

  • Always escape user-generated content before inserting it into HTML to avoid XSS issues ⚠️
  • Escape text differently for HTML, attributes, and JavaScript contexts.
  • Escaping the core five characters is enough for most HTML pages.

Notes & limitations

  • This tool is intended for HTML. XML and other markup languages may require a broader escape set.
  • Decoding relies on the browser's parser and supports both named and numeric entities.
  • Double-encoding will produce nested entities (which is sometimes intentional).

Learn more

Feature 01

Text Paint

online text paint Draw ASCII art on a canvas with unicode characters. Convert image files to text, merge two text documents, rotate, crop and other useful features. TextPaint.com

Feature 02

Text Fancy

fancy text converters Fancy Text converters online to create ASCII art, π–˜π–šπ–•π–Šπ–— πŸ…πŸ…¦πŸ…”πŸ…’πŸ…žπŸ…œπŸ…” Ρ”Ε¦Ε¦Ρ”Ο‚Υ‡ΰΈ£ made with unicode characters. Highlight your messages and social media posts. TextFancy.com

Feature 03

Text Heads

heads and faces with characters Text face Κ•ΰ² ΰ²Ώα΄₯ΰ² Κ” gallery and editor to express emotions (γ€β—‰η›Šβ—‰)぀ and create portraits with plain text. Design your own or pick one from the gallery ( Ν‘~ ΝœΚ– Ν‘Β°) TextHeads.com

Need more features?