Decimal entity
- Input
- A
- Expected output
- A
This is the most direct form: the number between &# and ; is the character's own ASCII code, with no base conversion involved.
ascii html entities
Every numeric HTML entity is just an ASCII code (or a Unicode code point, beyond ASCII) wrapped in &# and ;, and this page walks through going from character to code and back again, in both notations HTML accepts: decimal and hexadecimal.
This is the most direct form: the number between &# and ; is the character's own ASCII code, with no base conversion involved.
The same character as the previous example, only the base changed: the x after the # tells the browser to read 41 as hexadecimal, not decimal.
The & character itself needs escaping because it is the trigger that opens any entity; writing a bare & in the middle of text can confuse the HTML parser.
No. ASCII covers only 128 codes. Unicode covers nearly all modern writing systems. The first 128 Unicode code points preserve ASCII compatibility, which makes every ASCII text a valid UTF-8 text as well.
None in the final result, both produce the letter A; the only difference is the number base: A reads 65 as decimal, A reads 41 as hexadecimal, and decimal 65 is exactly hexadecimal 41.
Five: & because it opens entities, < and > because they open and close tags, and double and single quotes because they delimit attribute values; any of them used unescaped in the wrong spot can be read as code instead of text.
It lets you write a character your keyboard or the file's encoding cannot represent cleanly, or it makes explicit, inside a code example or piece of documentation, exactly which code sits behind the symbol shown.
It is a different notation for the same result: & and & both produce the same &; named entities only exist for the most common symbols, while numeric entities cover any code point, including ones with no defined name.
Everything runs in your browser: no search, text or code sequence leaves your device.