HTML entities encode and decode

Paste text to encode it for HTML, or paste HTML to decode its entities, in your browser: nothing you type is uploaded.

  • Nothing uploaded
  • As you type
  • Any language
  • Free, no sign-up

Getting ready…

Quick facts from our tests

Check it yourself: once the page has loaded, turn off Wi-Fi and mobile data, and HTML Entities Encoder still works. Your browser's network panel (F12 on a computer) lists every request the page makes: you'll see Google's ad requests, and none of them carries your text. Our code never gives your text to the ad code. How we prove it

How to encode HTML entities

  1. Paste the text

    Or open a file.

  2. Encode or decode

    Pick which way.

  3. Copy the result

    Or download it.

When this tool isn't the right fit

  • Your entity names are rare ones, beyond the 19 common names. They stay as written when decoding. Their numbered forms are always decoded.
  • You need to encode a web address. Web addresses use percent codes; use URL Encode.
  • You want to check whether your HTML is valid, or strip its tags. This tool only encodes and decodes characters.

Why use PDFGuild's HTML entities encoder

More free tools

Private like this one: nothing you type or add leaves your device.

HTML Entities Encoder: the complete guide

Which characters are encoded, named and numbered entities, decoding, double encoding, real results and tips.

In this guide
  1. What it does
  2. Step by step
  3. What is encoded
  4. Real results
  5. Decoding
  6. Double encoding
  7. Common entities
  8. Everyday uses
  9. Opening a file
  10. Privacy
  11. Long texts
  12. Tips
  13. Limits
  14. Terms explained

What the HTML Entities Encoder does, and when you need it

The HTML Entities Encoder turns the characters that have a meaning in HTML into entities, so they show as text instead of being read as code: < becomes &lt;, & becomes &amp; and a double quote becomes &quot;. Choose Decode to turn entities back into the characters they stand for. Tick the box to encode every letter outside plain English as a numbered entity too, so é becomes &#233;. The result appears in the second box as you type, ready to copy or download.

It runs in your browser: your code and text are never uploaded and never saved, so closing the page forgets them.

Some jobs it is made for:

  • Showing code in a post or a page, so that a tag such as <p> appears as text instead of making a paragraph.
  • Putting text into an HTML attribute, such as a title or an alt text, where a quote would end it early.
  • Reading text full of entities copied from a page's source, an email or a feed.
  • Fixing double encoding, where &amp;amp; shows on a page instead of &.
  • Plain-ASCII HTML, for a system that mangles letters such as é and ₹.

Step by step: encoding and decoding

It takes a few seconds, and the same steps work on a phone and on a computer:

  1. Choose the way under Do: Encode (< becomes &lt;) or Decode (&lt; becomes <).
  2. Type or paste your text or code in the top box, or choose Open a text file, or drop a file anywhere on the page.
  3. For Encode, tick Encode every character outside plain ASCII too if the result must hold only plain English characters.
  4. Copy or download the result.

Press Try a sample: the box fills with a short HTML paragraph, <p class="note"> with Tom & Jerry's "best" café, a long dash and ₹500 in it. In the result the tag starts as &lt;p class=&quot;note&quot;&gt;, the & is &amp;, the apostrophe &#39; and the quotes &quot;. Café, the dash and ₹ stay as they are until you tick the box.

What is encoded, exactly

The rules are written here in full, and the same rules are checked by our tests.

CharacterEncoded asWhy
&&amp;It starts every entity
< and >&lt; and &gt;They start and end tags
"&quot;It ends an attribute's value
'&#39;It ends an attribute written in single quotes
With the box tickedEvery character above plain ASCII as its number: &#233; for é, &#8377; for ₹, &#128512; for 😀For pages or systems that keep only plain English characters
Everything elseAs it is: letters, digits, spaces, tabs and line breaksThey have no special meaning in HTML

Emoji and other characters beyond the first 65,536 are written as one number each, not as two halves, so 😀 becomes &#128512;, which every browser reads.

Real results from our tests

We tested HTML Entities Encoder with headless Chromium 148, the open-source browser Chrome is built on, on a Windows laptop with an Intel Core i7-1185G7 and 32 GB of memory, on 1 November 2026. Other work was running on the laptop at the same time, so times vary from run to run: each time below is the middle one of 3 runs.

Encoding is quick. It took 152 milliseconds or less to encode 500,000 characters of English, Hindi or a mix of English, Hindi, Tamil and emoji, with every character outside plain ASCII encoded too, the most the page takes at once.

After a text is put in the box, the page waits 0.15 second before it works, so a burst of typing is worked on once, and 0.4 second when the text has more than 400,000 characters. So the result of 500,000 characters of English showed between 0.53 and 0.54 second after it was put in the box in our test. A result of more than 100,000 characters shows only its first 100,000 in the box, and says so, because showing a very long text is slow for the browser; Copy and Download take all of it.

Checked by our tests. Every example on this page is one of our tests, run on the page's own code. They cover the five characters HTML needs encoded, every character outside plain ASCII with the box ticked, emoji as one number, named entities in capitals and small letters, decimal and hexadecimal numbers, unknown names and broken entities left as written, and double encoding undone one step at a time.

Size and offline. On a first visit the page downloads about 0.1 MB for the tool: the page, its styles, its scripts and the fonts, with Google's ad code not counted. In our test we switched the network off after the page had loaded and pressed Try a sample: the result showed 0.2 seconds later or less in each of 15 runs.

Phone-sized screen. We also ran the tests on a phone-sized screen in headless Chromium (390 × 844 pixels, with touch). That is not a real phone. Every button, box and tick box was 44 pixels high or more, and the page did not scroll sideways. These tests don't cover Safari or Firefox.

Try it yourself: press "Try a sample" at the top of this page. It puts a short HTML paragraph in the box, with a quote, an &, an apostrophe, an accent and a rupee sign. The result shows the tags and signs as entities. Then tick Encode every character outside plain ASCII too: café and ₹ become numbers.

Try the sample

Decoding entities

Decode turns entities back into characters:

  • Numbered entities, in decimal (&#8377;) or hexadecimal (&#x20B9; or &#X41;), for any character: both of those first two give ₹.
  • 19 common named entities: amp, lt, gt, quot, apos, nbsp, copy, reg, trade, hellip, mdash, ndash, lsquo, rsquo, ldquo, rdquo, euro, pound and rupee, in capitals or small letters: &COPY; gives ©. &nbsp; becomes a no-break space.

Anything else is left exactly as written: a name the tool doesn't know (&unknown;), a number that is no character (&#0;, or anything past the last Unicode character), and an entity without its closing semicolon (&#65). HTML has more than 2,000 named entities; the 19 here are the ones that appear most in everyday text, so a rarer name stays as written, and its numbered form always works.

The tool also reads &rupee; as ₹. That name is not part of HTML, so a browser shows it as written: on a web page, use &#8377; for the rupee sign.

The HTML Entities Encoder after its sample: a short HTML paragraph with its tags, quotes, ampersand and apostrophe written as entities
Our sample HTML, encoded in the browser.

Double encoding, and how to fix it

When text is encoded twice, the & of each entity is encoded again, and the page shows the entity instead of the character: a reader sees &amp; or &lt; instead of & or <. It happens when a system encodes text that was already encoded, for example a form that encodes what you paste from another page's source.

To fix it, decode once and look: &amp;amp; decoded once gives &amp;, decoded again gives &. Each decode undoes one layer, so decode until the text reads right, and stop there. Decoding too far can turn text that should show a code example into real tags.

The opposite mistake is not encoding at all: a < in a comment or a title can break the page around it, or make text disappear. Encoding before you paste into HTML prevents both.

The entities you meet most

These are the entities that turn up most in everyday text, with their names and numbers. Both forms give the same character, and this tool decodes all of them:

CharacterNameNumber
© copyright&copy;&#169;
® registered&reg;&#174;
™ trade mark&trade;&#8482;
₹ rupeenone in HTML&#8377;
€ euro&euro;&#8364;
£ pound&pound;&#163;
No-break space&nbsp;&#160;
… ellipsis&hellip;&#8230;
Long dash&mdash;&#8212;
’ curly apostrophe&rsquo;&#8217;

The number is the character's place in Unicode, so it works for every character, including ones with no name, such as ₹ and the letters of Hindi: &#2344; is न. Text copied from a word processor often brings curly quotes and the ellipsis with it, which is why they appear in so many pages' source.

Everyday uses

  • A code example in a blog post: encode the code, then paste it inside your post's code block.
  • An alt text or title with quotes: encode it so its quotes don't end the attribute.
  • Read an email's source: decode its entities to see the words.
  • Plain-ASCII HTML for an old system: tick the box and every é, ₹ and emoji becomes a number.
  • Other encodings for other places: URL Encode for web addresses, JSON Escape for JSON strings, Base64 for data.

Opening a text file

Choose Open a text file, or drop a file anywhere on the page, and the tool reads it on your device. These files open: .txt, .md, .csv, .tsv, .log, .json, .xml, .srt, .vtt, .html and other plain-text files, with up to 500,000 characters. The file's name and size appear below the box with an x; press the x to remove the file's text. The file is read on your device and never uploaded. The result can be copied, or saved as a new text file; the file you opened is never changed.

  • Letters. A file saved as UTF-8 (a byte order mark at the start is dropped) or as UTF-16 with a mark is read correctly, Hindi and Tamil included. A file that is not valid UTF-8 is read as Windows-1252, and the page says so: "This file isn't saved as UTF-8, so it was read as Windows-1252. If letters look wrong, save it as UTF-8 and add it again."
  • Windows line breaks. A Windows file stores each line break as two characters. The tool reads the pair as one line break, so line breaks are kept as they were.
  • Several files. Only the first one opens, and the page says so, for example "Opening a.txt only. Open the others one at a time."
  • Not a text file. A Word, PDF or picture file renamed to .txt is not read, and the page says it doesn't look like a text file. A file named .docx, .pdf or .rtf gets this message: "Only text files (.txt and similar) can be opened here. For a Word or PDF file, copy its text and paste it into the box."
  • Empty or too long. An empty file says it is empty. A file with more than 500,000 characters is not opened, and the page says how many characters it has.

For a Word or PDF file, open it in the program you normally use, select the text, copy it, and paste it into the box. A PDF whose pages are scans holds pictures, not text, so there is nothing to copy.

Private: your text stays on your device

Your text never leaves your device. The tool runs inside your browser and has no upload step: it never sends the text you type, paste or open anywhere, and it keeps no copy of it, so closing the page forgets it. The page's Content Security Policy lets it contact only this site and Google's ad service, which pays for the site; our code never gives your text to the ad code. You can check it yourself in your browser's network panel (F12 on a computer): encoding and decoding adds no request that carries your text. The site's menu does remember the last few tools you opened, on your device.

Code and drafts can hold private details: an unpublished page, an email template, keys pasted by mistake. This tool encodes them without handing them over. Our privacy policy says what we collect, and How we prove it shows how you can check our claims yourself.

Once the page has loaded, it also works with the internet switched off. In our test we switched the network off after the page had loaded and pressed Try a sample, and the result showed 0.2 seconds later or less in each of 15 runs.

The HTML Entities Encoder after its sample: a short HTML paragraph with its tags, quotes, ampersand and apostrophe written as entities, at a phone's size with the internet switched off by our test, between our test's bands that read "Internet switched off" and "Nothing uploaded: 0 requests sent data"
Proof from our testOn 9 November 2026, our test opened HTML Entities Encoder at a phone's size, switched the internet off and ran it on its built-in sample. It finished with no connection, and none of the page's 15 requests sent any data.How we test, and how to check it yourself

Long texts

The tool takes up to 500,000 characters at once, about 500 KB of English text. What happens when a text is longer:

  • A paste that would go over the limit is not added. This holds for Ctrl+V, for press and hold, and for the Paste button. The page says, for example: "That text is very long (550,000 characters), so it was not added. The box can hold 500,000 characters. Split it into smaller parts for faster results."
  • A file with too many characters is not opened. The page says, for example: "long.txt has 550,000 characters, more than the 500,000 counted at once. Split it into smaller parts for faster results."
  • A text that gets in some other way stays, unchanged. If text is dragged into the box, for example, it stays there, the result stays empty and the note says: "This text is very long (550,000 characters). Split it into smaller parts for faster results."

Encoding is quick. In our tests it took 152 milliseconds or less to encode 500,000 characters of English, Hindi or a mix of English, Hindi, Tamil and emoji, with every character outside plain ASCII encoded too. The slow part is the browser showing a very long text in a box, so a result of more than 100,000 characters shows only its first 100,000, without cutting an emoji in half, and the note says so, for example "Showing the first 100,000 of 164,999 characters. Copy and Download take all of it." Copy and Download always take the whole result.

Tips

  • Encode once. Encoding already encoded text gives double encoding.
  • Decode one step at a time when fixing double encoding.
  • Use numbered entities for rare characters: they always work.
  • Leave the box unticked for modern pages saved as UTF-8: é and ₹ work as they are.
  • Use &#8377;, not &rupee;, for the rupee sign in a page.
  • Keep your own copy. The page forgets everything when you close it.

Limits

  • 19 named entities are decoded; other names stay as written, while every numbered entity is decoded.
  • No named entities out. Encoding writes only the five above, and numbers with the box ticked.
  • No HTML check. It doesn't tell whether the HTML is valid, or remove tags.
  • Not URL encoding: web addresses use percent codes, made by URL Encode.
  • 500,000 characters at once, about 500 KB of English text.

Terms explained

HTML entity
A code that stands for a character in HTML, starting with & and ending with a semicolon, such as &lt; for <.
Named entity
An entity written with a name, such as &copy; for ©.
Numbered entity
An entity written with the character's number, such as &#169; or &#xA9; for ©.
ASCII
The 128 characters of plain English text: letters, digits and common symbols.
Double encoding
Text encoded twice, so that entities show on the page instead of characters.

Frequently asked questions

How do I encode HTML entities?

Paste your text into the top box with Encode chosen. &, <, >, the double quote and the apostrophe become entities at once. Copy the result, or download it.

How do I decode HTML entities?

Choose Decode and paste the text. Numbered entities and 19 common named ones, such as the ones for the ampersand and the copyright sign, turn back into characters.

Which characters must be encoded in HTML?

& and < always, > for safety, and the double quote and the apostrophe inside attributes. This tool encodes all five.

What does the ASCII box do?

It also encodes every character outside plain English as a numbered entity: é becomes the entity numbered 233, ₹ the one numbered 8377 and 😀 the one numbered 128512.

Why does my page show entity codes instead of symbols?

Because the text was encoded twice, so the codes themselves were encoded. Decode it once and check; repeat until it reads right.

Why wasn't an entity decoded?

It may be a name outside the 19 common ones, a number that is no character, or an entity without its semicolon. Those stay as written; numbered entities always work.

Is there an HTML entity name for the rupee sign?

No. HTML has no name for ₹. The tool reads the name rupee as ₹, but browsers don't, so in a page use the numbered entity, 8377.

Is this the same as URL encoding?

No. Web addresses use percent codes such as %20. Use URL Encode for them.

Does it keep line breaks?

Yes. Line breaks, spaces and tabs stay as they are, both ways.

Does it work for Hindi?

Yes. Hindi stays as it is when encoding, unless you tick the box, which writes each character as its number, such as the entity numbered 2344 for न.

Is HTML Entities Encoder free?

Yes. There is no sign-up and no watermark, and you can use it as often as you like. Ads from Google help pay for the site. They are kept apart from the tool, and our code never gives them your text.

Is my text uploaded anywhere?

No. The tool has no upload step: it works inside your browser and never sends the text you type, paste or open anywhere, and it keeps no copy of it. Google's ad code is on the page, and our code never gives it your text. How we prove it shows how to check.

How much text can it take at once?

Up to 500,000 characters, about 500 KB of English text. A paste or a file that would go over is not added, and the page says so. In our tests it took 152 milliseconds or less to encode 500,000 characters of English, Hindi or a mix of English, Hindi, Tamil and emoji, with every character outside plain ASCII encoded too. See Long texts.

Can I open a text file, or a Word or PDF file?

A text file, yes: choose Open a text file or drop a .txt, .csv or similar file on the page, with up to 500,000 characters. A Word or PDF file must have its text copied out first, because the tool reads text, not those files.

Does it work offline?

Yes, once the page has loaded. In our test we switched the network off after the page had loaded and pressed Try a sample: the result showed 0.2 seconds later or less in each of 15 runs. If you open the page for the first time with no internet, it can't load.

By the PDFGuild team · Updated · How we test