HTML Encode / Decode
Escape & unescape HTML entities.
100% private — runs in your browser, nothing is uploaded.
How to use the HTML Encode / Decode
- 1Enter text or HTML
Paste the text or HTML markup you want to convert.
- 2Encode or decode
Click Encode HTML to escape entities, or Decode HTML to turn entities back into characters.
- 3Copy the result
Copy the encoded or decoded output with one click.
Examples
| Input | Output |
|---|---|
<b>Bold & bright</b> | <b>Bold & bright</b> |
She said "hi" | She said "hi" |
Free online HTML encoder & decoder
This HTML encoder / decoder escapes special characters into HTML entities, or converts entities back into plain text. It is essential for displaying code snippets, preventing markup from breaking, and handling user-generated content safely.
Examples
<div>becomes<div>when encoded.&becomes&when decoded.
Runs 100% in your browser — nothing is uploaded.
Frequently Asked Questions
What is HTML encoding?
HTML encoding replaces special characters like <, >, & and " with entity codes (<, >, &, ") so they display as text instead of being interpreted as HTML markup.
When should I encode HTML?
Encode HTML when you want to show code or user input on a web page safely, or to prevent characters from breaking your markup. Decode to turn entities back into normal characters.
Is my input private?
Yes — encoding and decoding happen entirely in your browser.
Which characters get encoded?
The five that affect HTML: & becomes &, < becomes <, > becomes >, " becomes " and ' becomes '. Everything else is left as-is.
Does HTML encoding prevent XSS?
Encoding output that contains user input is a key defence against cross-site scripting, because it stops the browser from treating the text as executable HTML. Always encode untrusted content before displaying it.