Quecko Logo

Free tool • Runs in your browser

HTML encoder

Encode special characters as HTML entities, or decode entities back to text.

Loading tool...

Quick answer

Encoding turns characters like < and & into entities such as &lt; and &amp;, so that browsers display them as text. Decoding reverses the process.

How to use it

  1. Paste your text or HTML.
  2. Choose encode or decode.
  3. Copy the result.

Example

Input
<b>Tom & Jerry</b>
Output
&lt;b&gt;Tom &amp; Jerry&lt;/b&gt;

Common errors and how to fix them

I see &amp;amp;
The text was encoded twice. Decode it once.

Frequently asked questions

What is HTML encoding?

It replaces special characters with entities, such as < with &lt;, so that browsers display them as text.

How do I HTML encode text online?

Paste your text here, choose Encode, and copy the result.

What is the HTML encoded value of &?

It is &amp;. Similarly, < is &lt; and > is &gt;.

How do I escape HTML tags?

Encode the < and > characters, so that a tag appears as text instead of being run by the browser.

How do I HTML encode in JavaScript?

JavaScript has no single built-in function. Set an element's textContent in the DOM, or replace the special characters.

How do I HTML encode a string in C#?

Use System.Net.WebUtility.HtmlEncode. Use HtmlDecode to reverse it.

How do I decode an HTML encoded string?

Choose Decode here and paste the text. Entities such as &amp; turn back into their characters.

Why do I see &amp;amp; in my text?

It was encoded twice, so decode it once.

Does HTML encoding prevent XSS?

It helps in HTML text, but use your framework's escaping for the right context, such as attributes, URLs or scripts.

Is what I paste uploaded?

No. Everything runs in your browser and nothing is sent to Quecko.

More developer tools

Need something built for your business?

Quecko designs and builds AI, Web3 and custom software products.

Start a Project