Paste your text
Paste plain text, HTML, or entity-encoded content. Line breaks and multi-line input are preserved.
Encode or decode HTML entities instantly in your browser. Escape special characters for safe display, or convert HTML entities back into readable text. Ideal for code snippets, debugging markup, and handling user input.
How it works
Paste your text and choose Encode or Decode. Encoding turns special characters into HTML entities so they display safely; decoding turns entities back into normal characters. Everything runs locally in your browser.
Paste your text
Paste plain text, HTML, or entity-encoded content. Line breaks and multi-line input are preserved.
Choose Encode or Decode
Use the tabs to switch between encoding (text → entities) and decoding (entities → text). Output updates live as you type.
Copy the result
Copy the output for use in HTML, attributes, documentation, or anywhere you need escaped or unescaped text.
Examples
These examples show how the HTML encoder and decoder behave.
Encode: Tom & Jerry
Input:Tom & Jerry
Output:Tom & Jerry
The ampersand is escaped so it displays correctly in HTML.
Encode: HTML tag
Input:<div class="note">Hello</div>
Output:<div class="note">Hello</div>
Safe to show as text instead of rendering as HTML.
Decode: named entities
Input:<div>Hello</div>
Output:<div>Hello</div>
Named entities are turned back into characters.
Encode: non-ASCII (option on)
Input:François & ☕
Output:François & ☕
With “Encode non-ASCII” on, characters like ç and ☕ become numeric entities.
Why use this tool
HTML encoding replaces characters like &, <, and > with entity references so they display as text instead of being interpreted as HTML. Decoding does the reverse: it turns entity references back into normal characters.
Common use cases:
Display user input safely
Escape HTML before showing user-generated content to prevent XSS and broken layout when the text contains <, >, or &.
Show code or markup as text
Encode HTML tags and attributes so they appear as literal text in docs, comments, or code samples instead of rendering.
Decode copied content
Paste entity-encoded text from emails, logs, or CMS output and decode it back into readable characters.
Handle attributes and quoted text
Encode " and ' for safe use inside HTML attribute values.
FAQ
<, >, &, ", and ' are converted into HTML entities (e.g., <, >, &). This prevents them from being interpreted as HTML and ensures they display correctly.
<div>Hello</div>) and select “Decode.” The tool converts HTML entities back into readable characters like <div>Hello</div>.
< and & with HTML entities so they display safely in web pages. URL encoding formats characters for use in URLs (e.g., spaces become %20). They serve different purposes and are not interchangeable.
< or & could be interpreted as markup. This helps prevent rendering issues and security risks like XSS.
< and > as < and > to prevent them from being treated as actual HTML tags. If you want the original characters back, use the Decode function.
&), decimal entities (&), and hexadecimal entities (&). All are correctly encoded and decoded.
&, <, >, ", and '. These characters can affect how HTML is parsed. In some cases, non-ASCII characters (like é or emoji) may also be encoded for compatibility.