How do I encode text into HTML entities?
Paste your text, leave the mode on Encode, and the five special characters are replaced instantly: the ampersand becomes the entity amp;, the less-than sign becomes lt;, the greater-than sign becomes gt;, the double quote becomes quot;, and the apostrophe becomes the numeric code 39, each wrapped with an ampersand at the front and a semicolon at the end. So a line of markup like a bold tag with a quoted word comes out as its escaped form, ready to paste into a web page where it will display as text instead of being interpreted as code. Tick the non-ASCII option to also encode accented letters and emoji as decimal codes: the accented e in café becomes the code 233, and an emoji becomes its full Unicode code point number.
What are HTML entities and why do they exist?
HTML entities are a way to write characters that have a special meaning in HTML, or that are hard to type, using plain ASCII text. A browser reading a page treats the less-than sign as the start of a tag, so if you want visitors to see a less-than sign itself, you write it as an entity and the browser displays the character. Entities come in three forms: named (amp, lt, gt, quot, copy, pi and hundreds more), decimal numeric (a hash, the decimal code point, a semicolon), and hexadecimal numeric (a hash, an x, the hex code point, a semicolon). All three can represent the same character; named entities are the most readable, while numeric codes can represent every character in Unicode, including emoji.
How do I decode entities back to text?
Switch the mode to Decode and paste the entity text. Named entities from a built-in list of common ones (punctuation, symbols, Greek letters, accented Latin letters, arrows, maths signs and more), decimal codes and hexadecimal codes are all converted back to the characters they represent, including emoji and other characters outside the basic range. Anything that looks like an entity but is not recognised is left exactly as written, so nothing is silently lost. Decoding is the right move when you receive escaped text from a database, an email template, a JSON payload or a scraped web page and need the readable original. Encoding and then decoding the same text returns it unchanged, which makes round-trip checks easy.
When should I escape HTML, and when should I not?
Escape whenever text is being inserted into a page as content rather than as markup: user comments, code examples in tutorials, attribute values, and any text that contains angle brackets, ampersands or quotes. Unescaped user text is both a display bug (tags swallow words) and a security hole (script injection), so escaping on output is a standard safety step in web development. Do not escape text that is meant to be markup, such as the tags of your own page template, and do not double-escape: encoding already-escaped text turns the ampersand of each entity into a new entity, so visitors see the raw entity text instead of the character. If your output shows entity text on the page, it was escaped twice; decode once or fix the pipeline.
What is the difference between named, decimal and hex entities?
They are three spellings of the same idea. Named entities use a memorable word: copy for the copyright sign, pi for the Greek letter, hellip for the ellipsis. Only a fixed set of names exists in the HTML standard (about 2,200, many for maths and accents), and this decoder covers the common ones used in everyday pages. Decimal entities use the character's Unicode code point in decimal, and hex entities use the same number in hexadecimal; both work for every character, which is why the encoder writes accented letters and emoji as decimal codes when you tick the non-ASCII option. Browsers treat all three forms identically. For the five special characters, named forms are the clearest; for anything else, numeric forms are the safest.
Is it free and private?
Yes. The HTML entity encoder and decoder is free, with no signup, no account and no limits. Conversion runs in your browser, so your text and code are never sent to a server, stored or logged, and they disappear when you clear the box or close the tab. That matters when you are escaping snippets from private projects, client work or internal tools. For developers preparing code examples, writers pasting symbols into a CMS, and anyone cleaning escaped text back into readable form, this page encodes and decodes HTML entities instantly in both directions.