Developer Free · no signup

HTML Entity Encoder / Decoder

Encode text to HTML entities or decode entities back to text. Escape <, >, &, quotes for safe display in HTML.

Paste any text containing < > & or quotes into the tool to get an HTML-safe version (with entities like &lt; &amp; &quot;). Add |||decode to an entity-encoded string to reverse the conversion. Everything runs in the browser — no data is stored, and the tool handles full Unicode including Turkish and Arabic characters.

Krawly Editorial Team avatarReviewed by Krawly Editorial TeamIn-house engineers, writers & reviewers·Updated

Explore More Free Tools

Discover 160+ free tools for web scraping, SEO analysis, OSINT, and more. 30 free uses every day — no signup required.

160+ Free Tools No Signup Required JSON / CSV / Excel 30 Uses / Day
Quick answer

Paste any text containing < > & or quotes into the tool to get an HTML-safe version (with entities like &lt; &amp; &quot;). Add |||decode to an entity-encoded string to reverse the conversion. Everything runs in the browser — no data is stored, and the tool handles full Unicode including Turkish and Arabic characters.

What is HTML Entity Encoder / Decoder?

The HTML Entity Encoder and Decoder is a free online tool that instantly converts special characters like <, >, &, and quotes into their corresponding HTML entities (&lt;, &gt;, &amp;, &quot;), and decodes entity sequences back into readable text. It's an essential utility for anyone working with HTML, email templates, XML, or content management systems — especially when you're displaying user-generated content and need to prevent cross-site scripting (XSS) attacks.

How to use HTML Entity Encoder / Decoder

  1. 1

    Paste your text or HTML

    Drop the raw content into the input box. It can be plain text you want to make HTML-safe, or HTML that already has entities you want to decode back to readable characters.

  2. 2

    Choose a mode

    Leave the text as-is to encode it (default). To decode entities back to characters, append |||decode to the end of your input — the tool will auto-detect and reverse the conversion.

  3. 3

    Get both variants at once

    The result shows the encoded and decoded versions side by side, plus a reference table of every entity the tool replaced so you can learn what each one represents.

  4. 4

    Copy the version you need

    Click the copy button next to the encoded or decoded output. No signup, no history stored — close the tab and the data is gone.

Try it when you need to…

  • Display raw HTML tags in a blog post or tutorial without browsers rendering them
  • Escape user comments before saving them to a database to block XSS
  • Decode scrambled text from an API response that double-encoded entities
  • Clean up HTML pasted from a WYSIWYG editor for a plain-text email

Use cases

  • Web development — safely embed user-generated text inside HTML without breaking markup
  • Security — prevent cross-site scripting (XSS) by escaping untrusted content before rendering
  • Email templates — encode special characters that break HTML email rendering
  • Documentation — show raw HTML tags as text in tutorials and code snippets
  • Debugging — decode entity-encoded strings pulled from logs, URLs, or databases

Key features

Instant encode and decode with both results shown side by side
Handles named entities (&amp;), numeric entities (&#38;), and hex entities (&#x26;)
Full Unicode support — encodes non-ASCII characters when needed
Append |||decode to any input to force decode mode
Lists each unique entity the tool replaced with its codepoint
No character limits, no signup, no data stored on our servers

Tips & best practices

Always encode user-supplied HTML on the server, not just in the browser — client-side escaping can be bypassed.

For email templates, encode both quotes and non-ASCII characters so legacy email clients don't mangle them.

If you see double-encoded output (like &amp;amp;), decode twice to get back to the original text.

Frequently asked questions

Any time you display untrusted or user-provided text inside an HTML page. Encoding prevents HTML injection and XSS attacks, and keeps your markup valid when user input contains <, >, or & characters.

They render the same character (&). &amp; is the named entity; &#38; is the numeric decimal entity; &#x26; is the hex form. All three are valid HTML and interchangeable — most developers prefer &amp; for readability.

Yes. The tool preserves Unicode by default. It only replaces the five core HTML-reserved characters (< > & ' ") plus any non-printable ones. Turkish ş ğ ç ö ü, Arabic script, and emoji pass through untouched.

No. HTML entities (&amp;) are for HTML context. URL encoding (%26) is for URLs. Use our URL Encoder/Decoder tool when you need to escape characters in query strings or paths.

No. All conversion happens at request time and nothing is logged or retained. Close the tab and the data is gone — safe for sensitive content.