HTML Entity Encoder & Decoder

Escape text for safe use in HTML (< & ") or decode entities like   and ₹ back to characters.

InstantPrivate — runs in your browserFree, no sign-up

Your details

Action
Encode
Style

Result

How to use

  1. 1

    Paste text or HTML.

  2. 2

    Choose Encode to escape it for HTML, or Decode to turn entities back into characters.

  3. 3

    Copy the result, or press Swap to reverse it.

Questions

Which characters must be escaped in HTML?

Always escape & as &amp; and < as &lt; in text. Inside attribute values also escape quotes (&quot; or &#39;). Escaping user input this way is the basic defence against cross-site scripting (XSS).

Is there an entity for the rupee sign ₹?

There's no named entity for ₹, but you can write it as &#8377; (decimal) or &#x20B9; (hex). With UTF-8 pages you can also type ₹ directly.

What is &nbsp;?

A non-breaking space — it looks like a normal space but stops the line from wrapping there, useful between a number and its unit such as “10&nbsp;kg”.

About this HTML Entities tool

HTML Entity Encoder & Decoder — Escape text for safe use in HTML (&lt; &amp; &quot;) or decode entities like &nbsp; and &#8377; back to characters. It is one of 200 free tools on namasivayam.in, made by software engineer Namasivayam Vadivelan for everyday use in India.

Everything is calculated instantly in your browser: nothing you type or upload is sent to any server, there is no sign-up, and it works on mobile and desktop. Paste text or HTML.

Related reading

Articles that go with this tool

All articles →

Related tools

More developer tools you may like

All 200 tools →

Results are estimates to help you plan. They are not financial, tax or medical advice.