What is an HTML entity?
An HTML entity is a character reference starting with an ampersand (`&`) and ending with a semicolon (`;`), used to represent reserved characters or non-printable symbols safely in HTML.
Why should I encode special characters in HTML?
Reserved characters like `<` or `>` can confuse HTML parsers and trigger Cross-Site Scripting (XSS) vulnerabilities if injected by users. Encoding them renders them safely as text.
What is the difference between Named and Decimal entities?
Named entities use text names (`<`), while decimal entities use numerical Unicode code points (`<`). Decimal entities are supported universally across all XML and HTML parsers.
How do I decode HTML entity strings?
Select `Decode` mode, paste the string containing entities (such as `<h1>`), and the tool instantly translates them back into standard text (`<h1>`).
Can HTML entity encoding prevent XSS attacks?
Yes. Encoding user input before reflecting it inside HTML body tags or attribute values prevents injected script tags from executing in the user's browser.
Are non-breaking spaces supported?
Yes. The decoder parses ` ` into standard space characters, along with symbols like `©` (©), `®` (®), and `™` (™).
Does it support emoji character encoding?
Yes. Emojis and high-plane Unicode characters can be encoded into decimal or hexadecimal entities (e.g. `😀` for 😀) for safe transport in legacy character encodings.
Why are some characters encoded as decimal instead of named entities?
Not every Unicode character has a named entity shorthand defined in the HTML5 specification. For those without names, the tool uses decimal or hexadecimal references.
What is the difference between Hexadecimal and Decimal entities?
Decimal entities use base-10 code points (`&`), while Hexadecimal entities use base-16 code points (`&`). Both are parsed identically by modern web browsers.
Is single quote (apostrophe) encoding valid in XML?
Yes. In XML and XHTML, single quotes encode as `'`, whereas in older HTML4 `'` was common. This tool supports both representations safely.
How does HTML entity encoding differ from URL encoding?
HTML entity encoding replaces reserved HTML markup characters (like `<` and `&`), whereas URL percent-encoding replaces characters invalid in web URLs (like spaces `%20` or `/` `%2F`).
Should I encode JSON payloads as HTML entities?
No. Standard JSON payloads use standard string escaping (`\"`). HTML entity encoding is specifically for data inserted into HTML documents or DOM nodes.
Is my input text sent to an external server?
No. All entity conversion runs 100% inside your browser using client-side JavaScript.
Are there keyboard shortcuts?
Press `Ctrl+L` (or `Cmd+L` on Mac) to clear the editor fields instantly.