HTML Entity Encoder

Encode special characters as HTML entities (<, &, " …) instantly in your browser. Free online HTML entity encoder/escape tool.

Loading calculator…

Results

Encoded output

What is this calculator for?

Convert special characters into their HTML entities so they display literally instead of being parsed as markup.

How to Use This Calculator

Enter the values below, then press Calculate (or press Enter). The calculator updates your results instantly. Try different values to see how your inputs change the outcome.

  1. Text to encode — enter a value. A typical Text to encode would be Type or paste text here….
  2. Encode set — enter a choice from the options.
  3. Review your results — the key output is highlighted, with supporting figures below.

What You'll Need

Text to encode
a value · required
Encode set
a choice from the options (All common (<, >, &, ", '), Only < > & (in HTML text), Only " (in attributes)) · optional

About This Calculator

When you write HTML, characters like <, >, and & are interpreted as markup. This encoder converts them into their entity form (&lt;, &gt;, &amp;) so they display as literal text.

Choose the encode set to match the context: plain text (< > &), attribute values (also &quot;), or all common characters. Encoding runs locally in your browser.

Worked Examples

Example

&lt;b&gt;Tom &amp; Jerry&lt;/b&gt;

Frequently Asked Questions

Why should I escape HTML?
Escaping prevents special characters from being interpreted as tags, which is essential for properly displaying user-generated content and avoids broken layouts.
What is the difference between modes?
In regular HTML text only <, >, and & need escaping. Inside a double-quoted attribute, you must also escape ". The "all" mode also escapes single quotes for safety.