- What are HTML entities?
- An HTML entity is a short code that stands for a character, written between an ampersand and a semicolon. < stands for <, & stands for &, and © stands for ©. Browsers show the character instead of the code. You use them for characters that HTML would otherwise read as markup, and for characters that are hard to type or might not survive a change of file encoding.
- How do I encode text as HTML entities?
- Leave the tool on Encode, choose which characters to escape and which entity format to use, then paste your text and click Encode. For showing code or user text on a page, choose Only HTML characters so the rest of your text stays readable in the source.
- How do I decode HTML entities back to text?
- Click Decode, paste text that contains entities such as &, ", or ', and click the Decode button. Every named, decimal, and hex entity is turned back into its character. Tags in the input are left as plain text, so nothing is removed.
- Which characters have to be escaped in HTML?
- In text between tags, always escape & and <, and escape > too by habit. Inside an attribute value, also escape the quote mark that wraps the value: " inside double quotes, ' inside single quotes. Only HTML characters escapes all five, which is safe in both places.
- What is the difference between named, decimal, and hex entities?
- They all produce the same character. A named entity uses a word (é), a decimal one uses the Unicode number (é), and a hex one uses the same number in hexadecimal (é). Named entities are easier to read but only exist for some characters. Decimal and hex work for every character, including emoji.
- Why does my page show & or " instead of & or a quote mark?
- The text was encoded twice. The first pass turned & into &, and the second pass escaped the ampersand at the start of that entity again, giving &amp;. To fix the text, decode it once to remove the extra layer. To fix the cause, find the step in your code or CMS that escapes text that was already escaped.
- Why does named mode write ' instead of ' for an apostrophe?
- ' was not part of HTML 4, so some older browsers and email clients do not recognize it. ' means the same thing and works in every version of HTML and in XML. The decoder reads both.
- Does escaping HTML stop XSS attacks?
- Escaping &, <, >, ", and ' is the standard defense when you put untrusted text between tags or inside a quoted attribute. It is not enough in other places: inside a <script> or <style> block, in an unquoted attribute, or in a link like href="javascript:...". Use your framework's built-in escaping, and treat this tool as a way to check or prepare text by hand.
- Does the decoder understand every HTML entity?
- Yes. Decoding uses your browser's own HTML parser, so it knows all of the more than 2,000 named entities in HTML5, decimal and hex references, and older forms like © written without the semicolon. The result matches what a browser would show for the same text.
- Is my text private?
- Yes. Encoding and decoding run in your browser, and nothing you type or paste is sent to a server.