Free

Free HTML Encoder & Decoder Online

A free online HTML encoder and decoder: turn HTML into entities and back — instant, private.

Free tool · No sign-up · Private

Private by design. Conversion is plain string replacement inside your browser. Your HTML is never uploaded or stored.

Formats & limits

What this tool handles

Straightforward limits, stated plainly.

Safe encoding

Encodes the five characters that matter for safety: & < > " and '. Everything else — including Unicode text — passes through untouched.

Named + numeric decode

Decodes named entities like &copy; and &nbsp;, decimal codes like &#169;, and hex codes like &#xA9;. Unknown entities are left as-is.

Live conversion

No buttons to press. The output updates with every keystroke, so you can experiment and learn what each character becomes.

Any length

Paste a snippet or a whole document — there's no practical input size limit for text conversion.


How it works

Three steps to escaped

Choose encode or decode

Pick Encode to escape HTML into entities, or Decode to turn &lt; &amp; &quot; style codes back into plain characters.

Paste your text

Drop in HTML markup, a code snippet, or entity-filled text. The result converts live as you type.

Copy the result

One click copies the output — paste it straight into your editor, CMS, or database field.


Use cases

When entity encoding helps

Display code on a page

Writing a tutorial with <div> examples? Encode the snippet so browsers show it as text instead of rendering it.

Prevent XSS

Encoding user input before inserting it into a page is the first line of defense against cross-site scripting.

Clean scraped text

Copied content full of &amp; and &nbsp; codes? Decode it to get plain text for your notes or database.

Email templates

Email HTML is picky about special characters in subject lines and preheaders. Encode them to avoid mangled output.

CMS migrations

Moving content between systems often double-encodes entities. Decode to normalize everything back to plain characters.


FAQ

HTML entity questions

What are HTML entities?
Entities are text codes that stand in for special characters in HTML: &lt; for <, &gt; for >, &amp; for &, &quot; for quotes. Browsers render them as the character, but the HTML parser doesn't treat them as markup.
Why do I need to encode HTML?
To display code or user input safely on a page. If you paste <script> into a page without encoding, the browser tries to run it. Encoding turns it into harmless visible text — the basis of preventing XSS attacks.
What's the difference between named and numeric entities?
Named entities use words: &copy; for ©. Numeric entities use the character's code point: &#169; or &#xA9;. Both render the same. This tool decodes both forms and encodes with the most common named entities.
When do I need the decoder?
When you scrape or copy content from a page and it arrives full of &amp; &nbsp; &quot; codes — decode them to get clean, readable text for your editor or database.
Is anything I paste uploaded?
No. Encoding and decoding happen with plain JavaScript string replacement inside your browser. Your HTML never leaves your device.
What characters get encoded?
The five structural ones: & < > " and '. These are the characters that can break markup or enable script injection, so escaping them is the safe default.

Keep exploring

Related tools

For developers

Need this programmatically?

YATools also exposes simple REST APIs for screenshots, audio, documents, and more — free tier included.

Explore the API →