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

  1. Copy <p>Tea & coffee</p> as plain text, including both tags.
  2. Run the HTML encoding and examine the resulting entity references.
  3. Check that the angle brackets and ampersand were encoded while Tea and coffee remain readable.

Worked example

Input

<p>Tea & coffee</p>

Expected result

&lt;p&gt;Tea &amp; coffee&lt;/p&gt;

Check the result

Look for &lt;, &gt; and &amp; in the result.

Continue with another guide

Cookie
We care about your data and would love to use cookies to improve your experience.

Learn how we use cookies