HTML Escape

Escape ampersands, angle brackets and quotation marks for text display.

Your workspace

Processed in your browser

Enter your values or try the example.

This tool converts special characters into their corresponding HTML entities, allowing you to display code snippets or markup directly on a webpage without the browser interpreting them as active elements.

How to escape HTML

  1. Paste the raw HTML or text containing special characters into the input field.
  2. View the converted output, where characters like < become &lt; and & become &amp;.

Practical application

The tool performs character-level replacement. This is essential for preventing XSS vulnerabilities when rendering user-provided input, though it is not a complete sanitization solution for complex HTML structures.

Example conversion

<div>Text & Symbols</div>

&lt;div&gt;Text &amp; Symbols&lt;/div&gt;

Questions about this operation

Does this tool sanitize HTML?

No, it only escapes specific characters for safe display. It does not remove malicious scripts or invalid tags.

Can I reverse this operation?

Yes, you can use the HTML unescape tool to convert entities back into their original characters.

Continue your workflow

Explore more tools in this category for your next step.