HTML Entity Encode / Decode
Local ProcessingConvert characters such as <, & and " to HTML entities or back.
How It Works & Processing Standards
Convert characters such as <, & and " to HTML entities or back.
Tool processing runs in your browser. If you create a calculator or conversion share link, its values are included in the URL. See the privacy policy for account, analytics and advertising data.
Current Limits
- Maximum input length: 100,000 characters
Choose encode or decode under "Task" — for showing code samples on a web page or reading entities in page source.
What You Can Do
- Encode
- Turns <, >, &, " and ' into entities, optionally all non-ASCII characters too.
- Decode
- Turns named and numeric entities like < or 가 back into characters.
How to Use HTML Entity Encode / Decode
- 1Choose a taskEncode or decode.
- 2Enter textWhen encoding, choose whether to include non-ASCII characters.
- 3CopyPaste into HTML source or text.
Examples
Show tags as text
Input: <b>Tom & Jerry</b>
Result: <b>Tom & Jerry</b>
Decode entities
Input: <p>5 > 3 && 2 < 4</p>
Result: <p>5 > 3 && 2 < 4</p>
Common Use Cases
- Showing HTML code samples on a blog
- Reading entities in RSS or XML data
- Checking special characters before inserting user input into HTML
Frequently Asked Questions (FAQ)
Does this prevent XSS?
It helps for text content, but attributes, URLs and scripts each need different handling. Use your framework’s escaping in real services.
Should non-ASCII text be encoded?
Not for UTF-8 documents. Turn on "encode all non-ASCII" only for older systems.
