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 <, & becomes & and a double quote becomes ". 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 é. 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;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:
- Choose the way under Do: Encode (< becomes <) or Decode (< becomes <).
- 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.
- For Encode, tick Encode every character outside plain ASCII too if the result must hold only plain English characters.
- 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 <p class="note">, the & is &, the apostrophe ' and the quotes ". 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.
| Character | Encoded as | Why |
|---|---|---|
& | & | It starts every entity |
< and > | < and > | They start and end tags |
" | " | It ends an attribute's value |
' | ' | It ends an attribute written in single quotes |
| With the box ticked | Every character above plain ASCII as its number: é for é, ₹ for ₹, 😀 for 😀 | For pages or systems that keep only plain English characters |
| Everything else | As it is: letters, digits, spaces, tabs and line breaks | They 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 😀, 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 sampleDecoding entities
Decode turns entities back into characters:
- Numbered entities, in decimal (
₹) or hexadecimal (₹orA), 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:
©gives ©. 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 (�, or anything past the last Unicode character), and an entity without its closing semicolon (A). 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 ₹ for the rupee sign.
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 & or < 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; decoded once gives &, 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:
| Character | Name | Number |
|---|---|---|
| © copyright | © | © |
| ® registered | ® | ® |
| ™ trade mark | ™ | ™ |
| ₹ rupee | none in HTML | ₹ |
| € euro | € | € |
| £ pound | £ | £ |
| No-break space | |   |
| … ellipsis | … | … |
| Long dash | — | — |
| ’ curly apostrophe | ’ | ’ |
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: न 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.
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 ₹, 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 < for <.
- Named entity
- An entity written with a name, such as © for ©.
- Numbered entity
- An entity written with the character's number, such as © or © 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.