HTML Encode
Free online HTML encoder — escape special characters like <, >, &, and quotes into safe HTML entities.
HTML encoded result
HTML Encode Online
Paste any text into the field above and click HTML Encode to escape special characters into safe HTML entities. Everything runs in your browser — nothing is sent to a server.
What Is HTML Encoding?
HTML encoding replaces characters that have special meaning in HTML with their entity equivalents so they display literally instead of being interpreted as markup. For example, < becomes < and & becomes &.
Characters That Get Encoded
&→&<→<>→>"→"'→'
Common Uses
- Safely embedding user-generated content in HTML to prevent XSS attacks
- Displaying code snippets or HTML source inside a web page
- Preparing text for insertion into HTML attributes
How to Use This Tool
- Paste your text into the input field.
- Click HTML Encode.
- Copy the result with the copy button.
Frequently Asked Questions
What is HTML encoding?
< becomes < and displays as < rather than starting a tag.Which characters get encoded?
< (less than) becomes <, > (greater than) becomes >, & (ampersand) becomes &, " (double quote) becomes ", and ' (single quote) becomes ' or '.When should I use HTML encoding?
What's the difference between encoding and sanitization?
Can I encode non-ASCII characters?
é becomes é or é. This ensures compatibility with older systems that may not support UTF-8.