HTML Encode
Prepare a code sample so its HTML markup can be displayed as literal text.
Prepare a code sample so its HTML markup can be displayed as literal text.
How to use
- Copy <p>Tea & coffee</p> as plain text, including both tags.
- Run the HTML encoding and examine the resulting entity references.
- Check that the angle brackets and ampersand were encoded while Tea and coffee remain readable.
Worked example
Input
<p>Tea & coffee</p>Expected result
<p>Tea & coffee</p>Check the result
Look for <, > and & in the result.