HTML Entity Encoder

Escape markup so browsers display it instead of parsing it

Free Online HTML Entity Encoder

The moment you paste a code sample or a sentence containing < or & into a web page, the browser tries to interpret it as markup. Encoding those characters as HTML entities makes the page show exactly what you typed - essential for docs, blogs, and templates.

  • Angle brackets escaped - < becomes &lt; and > becomes &gt;
  • Ampersands handled safely - & becomes & so existing text is never misread as an entity
  • Quotes escaped - double quotes become " for safe use inside attributes
  • Slashes hardened - forward slashes are written as &#x2F;, so closing tags in samples can never break out
Open HTML Entity Encoder

How to Encode HTML Entities

  1. Open the HTML entity encoder
  2. Paste the text or markup you want to display literally
  3. Click "Convert" to get the entity-escaped version
  4. Paste the output into your HTML where the text should appear

Example Conversion

Input (Text / HTML):

<p>Tom & Jerry said "5 > 3"</p>

Output (Entity-Encoded):

&lt;p&gt;Tom &amp; Jerry said &quot;5 &gt; 3&quot;&lt;&#x2F;p&gt;

Common Use Cases

Code Samples in Posts

Show readers real tags in a tutorial without the browser rendering them.

Documentation Examples

Embed markup examples in docs and READMEs that render on the web.

Template Safety

Escape user-generated text before dropping it into a page template.

Attribute Values

Put sentences containing quotes into HTML attributes without breaking the tag.

Related Tools