An HTML entity encoder replaces characters that have a special meaning in HTML with entities: & becomes &, < becomes <, > becomes > and quotes become " and '. That lets you display code or user text on a page without the browser treating it as markup. The decoder does the reverse.
How to use the HTML Entity Encoder
- Choose encode or decodePick "Encode to entities" to escape text, or "Decode entities" to turn entities back into characters.
- Paste your textPaste the text or HTML. When encoding, choose whether only the five special characters or all non-ASCII characters should be converted.
- Copy the resultCopy the output and paste it into your page, template or CMS.
Why HTML entities exist
A browser reads < as the start of a tag and & as the start of an entity. If you want those characters to appear as text, for example when showing a code sample or printing something a visitor typed, they must be escaped. An HTML entity encoder does that for you:
&becomes&<becomes<and>becomes>"becomes"and'becomes', which matters inside attribute values
Escaping these five characters is also the basic defence against cross-site scripting (XSS) when untrusted text is placed in HTML content or a quoted attribute. It is not enough inside <script> blocks, inline event handlers or URLs, which need their own escaping rules.
On a UTF-8 page, which is nearly every page today, you do not need to encode accented letters, symbols or emoji. The other encoding options are there for legacy systems, some email templates and tools that only accept ASCII. The recommended mode still writes the invisible non-breaking space as so you can see it.
Named, decimal and hex entities
There are three ways to write the same character. The copyright sign can be © (named), © (decimal code point) or © (hexadecimal). Numeric forms work for every Unicode character, including emoji; names exist only for a fixed list. In the "named" mode this tool uses the well-known HTML 4 names (Latin letters, Greek letters, punctuation, arrows and maths symbols) and falls back to decimal numbers for everything else.
The decoder understands all three forms and the full set of names your browser knows. Unknown names such as &bogus; and an & with no semicolon are left untouched. Invalid code points are replaced with the Unicode replacement character.
Decoding is done as plain text handling, so pasted markup is never run. Nothing leaves your browser. For escaping text in links, see the URL encoder.
Frequently asked questions
What does an HTML entity encoder do?
It replaces characters that HTML treats as markup, mainly &, <, > and quotes, with entities such as & and <. The browser then shows them as text instead of interpreting them.
Which characters must be escaped in HTML?
In normal content, & and <. Inside quoted attribute values, also the quote character. Escaping all five of & < > " and ' everywhere is the simple, safe habit.
Do I need to encode accented letters and emoji?
Not if your page is served as UTF-8, which is the standard. You only need numeric or named entities for them in old systems that cannot handle UTF-8.
What is the difference between and a normal space?
is a non-breaking space. The browser will not wrap a line at it and does not collapse several of them into one, unlike ordinary spaces.
Is my text uploaded?
No. Encoding and decoding happen in your browser and the text is not sent anywhere.
Last updated 24 November 2026 by the TheTechFolk team.