What Is HTML Encoding?
HTML encoding converts special characters into their corresponding HTML entities so they display correctly in a browser without being interpreted as HTML markup. For example, < becomes < and & becomes &.
Characters Encoded
| Character | HTML Entity |
|---|---|
& | & |
< | < |
> | > |
" | " |
' | ' |
How to Use
- Paste or type your text in the input box.
- The encoded result appears instantly in the output box (Auto mode on by default).
- Copy the result or upload a text file for bulk encoding.
- You can also pre-fill the input via URL: append
?input=your+textto the page URL and the tool will encode it automatically on load.
When to Use HTML Encoding
- Displaying user-submitted content safely in a web page
- Embedding code snippets inside HTML without breaking the markup
- Preventing XSS (Cross-Site Scripting) vulnerabilities
- Storing HTML content in XML or JSON attributes