Skip to content

Escape HTML

Replaces special HTML characters such as & and quotes (and the angle brackets of tags) with HTML entities so the text can be shown safely inside a web page.

0 characters

What is Escape HTML?

HTML uses characters such as < and > to mark up a page. If you want those characters to appear as plain text, they must be replaced with HTML entities, for example &lt; for the less-than sign.

This replacement is called escaping.

What this tool does

Converts the special HTML characters in your text into their entity form, so the text can be shown on a web page or placed inside HTML without being treated as markup.

How to use it

  1. Paste the text or code you want to display safely.
  2. Leave Auto ticked or press the button.
  3. Copy the escaped text and paste it into your HTML.

Did you know?

  • Escaping user-provided text before showing it on a page is one of the main defences against cross-site scripting (XSS).
  • The ampersand must be escaped first when doing it by hand, otherwise entities that were just created get escaped a second time.

More tools in this category