Quick Work Studio logo Quick Work Studio

Text Tools

HTML Entity Encoder & Decoder

Escape < > & and quotes into HTML entities so they display as text, or unescape entities back to characters.

About the HTML Entity Encoder & Decoder

In HTML, a few characters have special meaning: "<" starts a tag and "&" starts an entity. To show them as normal text on a web page, they have to be written as HTML entities. This tool escapes text into entities and decodes any entity, named or numeric, back into characters, as you type.

What you can do with the HTML Entity Encoder & Decoder

The five characters that get encoded

& becomes &amp;, < becomes &lt;, > becomes &gt;, the double quote becomes &quot; and the single quote becomes &#39;. The ampersand is handled first, so the entities themselves aren't encoded twice.

When you need it

Use it when showing code examples on a web page or in a blog post, or when placing text inside an HTML attribute. Escaping is also part of how websites prevent HTML injection, although real applications should rely on their framework's built-in escaping.

What decoding covers

Every named entity browsers understand, from &amp; and &nbsp; to &copy;, &rarr; and &hellip;, plus numeric ones like &#8377; and &#x20B9;. The counter shows how many entities were found.

Related tools

Frequently Asked Questions

Why does my text show "&amp;amp;"?

It was encoded twice. Decode it once and it will return to a single encoded ampersand; decode again to get the plain character.

Do accented letters need to be encoded?

Not on a modern page saved as UTF-8. If you're pasting into an old system that only accepts ASCII, switch on "Also encode non-ASCII".

Which characters need to be escaped in HTML?

Five characters can be read as code: & becomes &amp;, < becomes &lt;, > becomes &gt;, the double quote becomes &quot; and the single quote becomes &#39;. Encode mode replaces all five and shows how many it escaped.

Why does code I paste into my blog post disappear?

The browser treats anything inside < and > as a real HTML tag, so it runs or hides it instead of showing it. Encode the code first and paste the result, and readers will see the tags as text.

What's the difference between named and numeric entities?

A named entity uses a word, like &copy;, while a numeric one uses the character's Unicode number in decimal (&#169;) or hex (&#xA9;). All three show ©. Decode mode understands both kinds, but not every character has a name.

What is the HTML code for the rupee symbol ₹?

The rupee sign is Unicode U+20B9, so it is written &#8377; in decimal or &#x20B9; in hex. Most modern pages can include ₹ directly in UTF-8, but switch on "Also encode non-ASCII" if you need the numeric form.

What is &nbsp; and what does it decode to?

&nbsp; is a non-breaking space, character 160, also written &#160;. It looks like a normal space but stops a line from breaking there, which keeps things like "₹ 500" together. Decoding turns it into that special space, not an ordinary one.

How do I keep line breaks when showing text on a web page?

HTML ignores ordinary line breaks, so separate lines run together. In Encode mode, switch on "Keep line breaks as <br>" and a <br> tag is added at the end of each line, so the text keeps its layout.

Does escaping HTML protect a site from script injection?

Escaping user text before adding it to a page is a key defence against cross-site scripting, because a <script> tag becomes harmless &lt;script&gt;. Text placed inside JavaScript or link addresses needs its own escaping, so this is not the only step.

How is an emoji written as an HTML entity?

Use its Unicode code point in decimal or hex. The waving hand 👋 is U+1F44B, so it becomes &#128075; or &#x1F44B;. With "Also encode non-ASCII" on, each emoji becomes one numeric entity like this.

Why does it use &#39; instead of &apos; for apostrophes?

&apos; was not part of HTML 4, so older browsers and some email programs do not recognise it. &#39; works everywhere and shows the same apostrophe. Decode mode reads both forms.

Related tools

One studio. 96 tools.
Zero installs.

Browse by category
All tools
Guides & articles
CalculatorsHow Much Electricity Do Your AC, Geyser and Fans Really Use?Turn the watts on an appliance label into units and rupees, see which appliances actually drive your bill, and find the easy savings. CalculatorsWhich Pack Is Really Cheaper? How to Compare Unit PricesBigger packs aren't always better value. A simple way to compare price per kg, per litre or per piece, plus the shopping traps to watch for. CalculatorsHow to Calculate Your Exact Age "As On" a Date for Exam FormsRecruitment notices ask for your age as on a cut-off date. Here's how to count it correctly in years, months and days, and the cases that trip people up. Text ToolsHow Many Words Is That? Word and Character Limits ExplainedHow many words fit on a page, how long a speech takes, and the character limits for posts, meta descriptions and SMS, with tips for cutting to fit. CalculatorsSIP vs Lumpsum: Which Builds More Wealth?How monthly SIPs and one-time lumpsum investing really compare, when each one wins, and why most people should not agonise over the choice. CalculatorsUnderstanding Your Salary: CTC, Gross and In-HandWhy your offer letter number is bigger than what lands in your account, what CTC really includes, and how to compare job offers fairly.

All articles →

Every tool on Quick Work Studio, free and in your browser. Prefer reading first? See the guides or full directory.