How to use this tool
- Enter text to escape.
- Select Update result to view the result.
- Check the method and assumptions below before using the result.
Input reference and sample values
Use the units and choices shown for each field. Sample values are provided for practice, not as recommendations.
| Input | Format and units | Sample |
|---|---|---|
| Text to escape | Keep the structure and separators shown in the sample. Line breaks are retained in this input. | <p>Tom & Jerry</p> |
Result for these sample inputs
<p>Tom & Jerry</p>
Select Try the example in the form to load these values and calculate them again. This replaces the current form inputs. Compare the result with the method and worked explanation below.
The method, explained
Replace ampersand, less-than, greater-than, double quote and apostrophe with their HTML entity forms in one pass.
<p> becomes <p> and Tom & Jerry becomes Tom & Jerry.
What to keep in mind
This is text escaping, not a general HTML sanitizer. JavaScript, CSS and URL contexts have different escaping requirements. Already escaped entities are escaped again.
Common questions
Can I use this to sanitize an entire untrusted webpage?
No. It converts markup into literal text; use a maintained context-appropriate sanitizer for permitted HTML.
Is my content uploaded?
No. This tool processes the text in your browser. Copy only the result you intend to share.
Methodology maintained by ClarityKit. How these tools are built and checked.