About the HTML Encoder
Escape HTML special characters so text displays literally instead of being parsed as markup.
Also known as: html escape, encode html entities, escape html characters, xss escape.
How to use this calculator
- Enter text to escape.
- The result updates instantly as you type — press Calculate (or Enter) at any time.
- Review the breakdown shown under the main result.
- Use Copy result or Share to save the answer or send a link with your inputs.
Formula
& < > " and ' become their named or numeric entities
Worked example
Using the values pre-filled in the calculator above:
- Text to escape: <script>alert("hi")</script> & more
the calculator returns:
- Escaped HTML: <script>alert("hi")</script> & more
- Characters escaped: 7
- Original length: 35
- Escaped length: 61