HTML Entity Encoder

Escape text so it displays safely in HTML instead of being interpreted as markup.

FreeNo sign-upRuns in your browserMobile-friendly

Loading tool…

Need help with this tool or found a problem? WhatsApp support Email

What does the HTML Entity Encoder do?

Characters like < and & have special meaning in HTML. To show them as text — for example code samples in a blog post — they must be written as entities: &lt;, &amp;. Escaping user-provided text is also the basic defence against cross-site scripting (XSS).

Choose basic escaping, named entities for common symbols, or numeric entities for every non-ASCII character (useful for systems that do not handle UTF-8).

How to use the HTML Entity Encoder

  1. Paste the text or HTML you want to display literally.
  2. Choose the encoding level.
  3. Copy the escaped result into your HTML.

Examples

Code sample

<p class="note"> → &lt;p class=&quot;note&quot;&gt;.

Common use cases

  • Showing code in blog posts and documentation
  • Escaping user input in templates
  • Preparing text for XML

Features and benefits

  • Private by design — your data is processed on your device and never uploaded.
  • Free with no account, no watermark and no usage limits.
  • Works on phones, tablets and desktops in any modern browser.

Limitations to know

  • For security, escape on the server or in your templating system too; this tool is for manual tasks.

Frequently asked questions

Which characters must be escaped?

& and < always; > and quotes inside attributes.

Named or numeric entities?

Both work in modern browsers. Numeric entities work for any character.

Does this prevent XSS?

Escaping is the core defence when inserting text into HTML, but use your framework’s built-in escaping in applications.

Embed this tool on your website

Add the free HTML Entity Encoder to your blog or website. Paste the code into your page’s HTML; the tool runs in your visitors’ browsers and stays up to date automatically. Please keep the credit line below the tool.

Free to use on any website. The tool runs inside an iframe served from viptools.pk; nothing your visitors type is sent to your site or ours. Preview the embedded version.