HTML entities are short codes that let you show special characters as plain text on a web page. The browser reads < as the start of a tag, so to display a literal less-than sign you write <. Escaping is the process of swapping such characters for entities; unescaping turns them back.
The HTML Entity Encoder on BISCS India does both directions in your browser. It can encode just the essential characters, or every non-ASCII character too, in named, decimal or hexadecimal style.
Why do some characters need escaping?
HTML uses a handful of characters as syntax. If they appear in your content unescaped, the browser may misread the page:
| Character | Entity | Why it matters |
|---|---|---|
& |
& |
Starts every entity |
< |
< |
Starts a tag |
> |
> |
Ends a tag |
" |
" |
Ends a double-quoted attribute |
' |
' |
Ends a single-quoted attribute |
Suppose you are writing a blog post that shows a code sample. If you paste the raw markup into your page, the browser renders a button rather than displaying the code. Escaped, it shows exactly what you typed:
<!-- What you want readers to see -->
<button class="pay">Pay ₹499</button>
<!-- What you put in the HTML source -->
<button class="pay">Pay ₹499</button>
How to escape or unescape HTML with BISCS India
- Open the HTML Entity Encoder.
- Choose Encode to escape, or Decode to turn entities back into characters.
- For encoding, set the options:
- Encode quotes (on by default) escapes
"and', needed for attribute values. - Encode all non-ASCII also converts characters like ₹, é or Hindi letters into entities.
- Style picks Named where possible, Decimal (
₹) or Hex (₹).
- Encode quotes (on by default) escapes
- Paste your text into Input. The Output updates instantly, with a count of how many entities were created or decoded.
- Click Copy, or Swap to reverse the direction and check a round trip.
Named, decimal and hex entities
The same character can be written three ways. The copyright sign, for example:
© named
© decimal code point
© hexadecimal code point
Named entities are easier to read, but they exist only for a fixed list of characters. The rupee sign has no widely supported named entity, so it is written as ₹ or ₹. Numeric entities work for any Unicode character, including emoji.
When should you encode all non-ASCII characters?
For a modern website served as UTF-8, you usually do not need to. You can type ₹, नमस्ते or ধন্যবাদ straight into the HTML. Encoding everything just makes the source harder to read.
Encoding all non-ASCII characters is useful when:
- An email template or older CMS field corrupts special characters.
- You are pasting HTML into a system whose character encoding you do not control.
- You need source files that contain only ASCII for a legacy toolchain.
Where escaping comes up in everyday work
You do not have to be a security engineer to need this. Some very ordinary situations:
- Writing tutorials or documentation. Any page that shows HTML, XML or JSX examples needs the angle brackets escaped, or the browser will try to render them.
- Pasting content into a CMS. Some WordPress fields, e-commerce product descriptions and newsletter builders treat input as raw HTML. A product title like
Kurta <Size M> & Dupattacan silently lose the part in angle brackets. - Building XML feeds. Sitemaps, RSS feeds and product feeds for marketplaces are XML, which is even stricter than HTML. A bare
&in a product name, such asTea & Snacks, makes the whole feed invalid. - Reading scraped or exported data. Text pulled from web pages or APIs often arrives full of
&,'and". Decoding it gives you clean, readable text before you put it in a spreadsheet or report. - Email templates. HTML emails are rendered by many different clients. Using entities for symbols like ₹ and © is a safe habit when you cannot be sure every client respects UTF-8.
In each case, the fix takes seconds: paste the text, copy the escaped or unescaped version, and move on.
Escaping and security (XSS)
Cross-site scripting (XSS) happens when an attacker gets their own script to run on your page, usually by submitting text that your site later inserts into HTML without escaping. A comment field containing a script tag, displayed raw, would execute in every visitor’s browser.
Escaping <, >, & and quotes before inserting user text into HTML turns that attack into harmless visible text. But a few cautions apply:
- Context matters. Escaping for an HTML text node is not enough for values placed inside a
href, astyleor a<script>block. Each context has its own rules. - Use your framework. React, Angular, Django, Laravel and most templating engines escape output by default. Bypassing that, for example with
innerHTMLordangerouslySetInnerHTML, is where bugs creep in. - This tool is for content, not a security layer. It is ideal for preparing code samples, fixing CMS content or debugging, not for sanitising user input in a live application.
In plain JavaScript, the safe way to insert user text is to set textContent rather than innerHTML:
el.textContent = userComment; // shown as text, never run as HTML
Common mistakes
- Double escaping.
&amp;on a page means something escaped twice. Decode once and fix the pipeline. - Forgetting the ampersand in URLs. Query strings in
hrefattributes should technically have&written as&. Browsers forgive this, but validators flag it. - Escaping inside code fences in Markdown. Most Markdown renderers escape code blocks for you. Escaping manually as well gives you visible
<on the page. - Using entities for spacing. A run of
to indent text is fragile. Use CSS margin or padding instead. - Assuming escaping equals sanitising. Escaping makes HTML inert; sanitising removes dangerous parts while keeping some formatting. They are different jobs.
Related tools
If you are cleaning up a page before publishing, the CSS / HTML / JSON Minifier can compress the final HTML. For characters in links rather than page content, use URL Encode / Decode, because URLs use percent-encoding, not HTML entities. And Markdown Preview is handy for checking how escaped text will render in Markdown-based docs.
Privacy
All conversion happens in your browser with JavaScript. Whatever you paste, whether email templates, internal pages or client copy, stays on your device.