Back to Tools

HTML Encode

HTML Encode

Sanitize text with HTML entities

0
0
Source Text / HTML

About the HTML Encode

Convert special characters into HTML entities so they display safely on a web page.

How to use the HTML Encode

  1. Type or paste your text into Raw Chars.
  2. Press Encode Entities.
  3. Use Copy Result to copy the output, or download it if the button is shown.

Worked example

<p> becomes &lt;p&gt;.

Tips

  • Encoding user input helps prevent HTML injection, but you should also escape output in your own code.

Frequently Asked Questions

So that characters like &lt; and &amp; show as text rather than being treated as code.
Live Support
We usually reply within minutes

Enter your name to start a conversation with our team.