HTML Encoder
Encode HTML special characters to HTML entities online. Safely escape &, <, >, ", and ' to prevent XSS and render HTML as literal text.
HTML-Entities Output
What is HTML Encoding?
HTML encoding (or HTML escaping) converts special HTML characters into their corresponding HTML entity equivalents. This prevents browsers from interpreting the characters as HTML markup.
How to use this tool
- Paste your text or HTML into the input field
- Click Encode to convert special characters to HTML entities
- Copy the encoded output for safe use in HTML documents
Characters encoded
| Character | Entity |
|---|---|
& | & |
< | < |
> | > |
" | " |
' | ' |
Common use cases
- Escaping user input before inserting it into HTML templates
- Preventing cross-site scripting (XSS) vulnerabilities
- Displaying code examples in HTML without browser interpretation
- Encoding content for safe storage in HTML attributes
- Embedding text content that contains HTML-like characters
Example
Input: <script>alert("Hello & World")</script>
Output: <script>alert("Hello & World")</script>
Privacy
All processing happens in your browser. Nothing is transmitted.