Escape converts ampersands, angle brackets, quotation marks and apostrophes into HTML entities.
Privacy: This tool performs conversion in your browser. The conversion code does not submit your input to a PHP endpoint.
How to escape HTML online
HTML escaping replaces characters that have special meaning in HTML with entity representations. This can help you display text literally instead of having the browser interpret it as markup.
-
01
Enter your text
Paste an HTML snippet, plain text or content containing characters such as <, >, & or quotation marks.
-
02
Choose the conversion mode
Select Escape HTML to encode special characters, or Unescape HTML to decode supported HTML entities.
-
03
Convert and copy the result
Select Convert, review the output and copy it or download it as a text file for your development workflow.
Important: Escaping text is context-dependent. HTML text, HTML attributes, JavaScript and URLs each have different encoding requirements.
What is HTML escaping?
HTML escaping converts certain characters into
representations that can be included as text in
HTML. For example, the less-than character can be
represented by <, and the
ampersand by &.
HTML entities may use named forms, such as
", or numeric forms, such
as '. This tool uses a
consistent set of common entities for escaping
and a browser HTML parser for unescaping.
<p title="Example">Tom & Jerry</p>
AFTER ESCAPING
<p title="Example">Tom & Jerry</p>
Common HTML entities
<represents the less-than character (<).>represents the greater-than character (>).&represents the ampersand (&)."represents the double quotation mark (").'represents the apostrophe (').
Frequently asked questions
What does an HTML escape tool do?
It converts selected special characters into HTML entities so they can be represented as text in an HTML context rather than interpreted as markup.
What is the difference between HTML escape and unescape?
Escaping converts characters such as <, > and & into entity forms. Unescaping converts supported HTML entities back into their corresponding characters.
Does HTML escaping make a website completely secure?
No. Escaping is only one part of safe output handling. The correct encoding depends on where data is placed. HTML text, quoted attributes, JavaScript, CSS and URLs require different handling. Use context-appropriate escaping and never rely on this tool alone to prevent cross-site scripting (XSS).
Will escaped HTML display as text in a browser?
When correctly inserted into an HTML text context, escaped markup is generally displayed as text rather than being interpreted as HTML elements. The result depends on the surrounding document and context.
Can I use this tool to escape HTML attributes?
This tool converts common HTML special characters, but production attribute handling must account for the exact context. Use quoted attributes and a context-aware escaping function in your application.
Does unescaping HTML execute scripts?
This tool returns decoded text in a textarea and does not insert the result into the page as executable markup. However, inserting decoded content into a live HTML document can create security risks. Treat untrusted content carefully.
Is my text uploaded to a server?
No server request is used for the conversion performed by this page. The JavaScript processes the input locally in your browser.
Is this HTML escape tool free?
Yes. You can use the HTML escape and unescape functions without creating an account.