Your data never leaves this tab

Free HTML Encoder & Decoder Online

Encode special characters to HTML entities (&, <, >, ") or decode them back — instantly in your browser.

Plain Text
HTML Encoded
Paste HTML entities in the input and click Decode

How it works

1

Paste your text

Enter the string containing characters you want to HTML-encode (or HTML entities to decode).

2

Encode or Decode

Click Encode to convert < > & " to entities, or Decode to reverse it.

3

Copy the result

Copy the encoded/decoded output to use in your HTML, template, or code.

4

All in the browser

Uses a textarea trick — a native browser technique. Zero server calls.

Common use cases

Preventing XSS

Before rendering user-supplied strings as HTML, encode them to prevent cross-site scripting attacks. < becomes &lt; and > becomes &gt;.

Displaying code in HTML

Encode HTML snippets before wrapping them in <pre><code> blocks so the browser renders them as text instead of parsing the tags.

Email template content

HTML emails often require entities for characters like ampersands, quotes, and angle brackets to render correctly across email clients.

Decoding received data

API responses or scraped data sometimes contain HTML entities. Decode them to get the plain-text values.

Frequently asked questions

What are HTML entities?

HTML entities are escape sequences for characters that have special meaning in HTML. For example, < is &lt;, > is &gt;, & is &amp;, and " is &quot;.

When should I HTML-encode?

Always encode user-supplied data before rendering it as HTML content. This is one of the primary defenses against cross-site scripting (XSS) attacks.

What is the difference between HTML encoding and URL encoding?

HTML encoding escapes characters for HTML context (&amp;). URL encoding escapes characters for URL context (%26). Use HTML encoding for content inside HTML pages; URL encoding for URL parameters.

Does this handle all Unicode characters?

The encoder converts the five critical HTML characters (< > & " '). For extended characters, use the numeric entity form (e.g., &#169; for ©).