Overview
HTML escaping replaces characters that have special meaning in HTML with their entity equivalents. This helps prevent broken markup and makes text safe to embed in HTML pages, snippets, and documentation. It is especially useful when you need to show code or user-generated text as plain content.
Use cases
- Display code examples without rendering HTML tags.
- Safely embed user text inside HTML content.
- Prepare templates, docs, or snippets for publishing.
- Avoid accidental markup when showing special characters.
How it works
- 1
Paste or type the text you want to escape.
- 2
The tool converts reserved HTML characters such as <, >, &, ", and ' into entities.
- 3
Copy the escaped output and use it in HTML, templates, or documentation.
Examples
Basic escaping
Input: <p>Tom & Jerry</p>
Output: <p>Tom & Jerry</p>
Reserved characters are converted to HTML entities.
Quotes and apostrophes
Input: He said: "It's fine"
Output: He said: "It's fine"
Quotes are escaped for safer embedding in attributes or content.
FAQ
What does HTML escaping do?
It converts reserved characters into HTML entities so text can be safely displayed in HTML without being interpreted as markup.
Is HTML escaping the same as sanitizing?
No. Escaping makes text safe to display, while sanitizing removes or filters unsafe HTML. They solve different problems.
When should I use HTML escape?
Use it when you want to show text or code literally in HTML, especially for user content, snippets, or documentation.
