HTML Entity Lookup
Look up an HTML entity or Unicode value, then compare named and numeric forms with context-safe escapes for copying into markup and code.{{ summaryTitle }}
{{ summaryLine }}
| Field | Value | Meaning | Copy |
|---|---|---|---|
| {{ row.field }} | {{ row.value }} | {{ row.meaning }} |
| Destination | Paste this | Use when | Copy |
|---|---|---|---|
| {{ row.destination }} | {{ row.value }} | {{ row.use }} |
The chart renderer is unavailable. Exact source lengths remain listed in the reference board.
HTML character references place a Unicode character into markup using ASCII source text. They are useful when a character would otherwise be parsed as markup, when source files need a visible escape, or when a project prefers a stable representation for symbols and spacing characters.
| Form | Source | Meaning |
|---|---|---|
| Named | © | A case-sensitive HTML name |
| Decimal numeric | © | Unicode code point 169 in base 10 |
| Hex numeric | © | Unicode code point A9 in base 16 |
| Literal text | © | The resolved Unicode character |
Named, decimal, and hexadecimal references can resolve to the same character. The choice usually affects readability and source length rather than what a browser displays. Named forms are not available for every character, while numeric forms can represent any valid Unicode scalar value allowed by the lookup.
A code point identifies one Unicode value. A visible grapheme can contain several code points, such as a base symbol followed by a combining mark. Treating the displayed glyph as one character can therefore hide the sequence that must be preserved for an exact round trip.
Context changes safe source syntax. Text between HTML tags, double-quoted attributes, single-quoted attributes, unquoted attributes, JavaScript strings, CSS strings, and URL components have different escaping rules. An HTML entity should not be copied unchanged into every one of those destinations.
Canonical HTML source ends named and numeric references with a semicolon. Browsers accept some legacy omissions, especially for older named references, but that behavior is context-sensitive and can turn following letters or punctuation into a different parse.
How to Use This Tool:
Choose whether the input should be decoded into Unicode text or encoded into source forms, or let its shape select the path.
- Select Auto detect, Decode entity or name, or Encode symbol or code point. Pin a direction when a bare word or number could be ambiguous.
- Enter one named or numeric reference, a bare entity name, a literal grapheme, or a sequence such as
U+2242 U+0338. - Choose the Preferred HTML output. Named-first uses a catalog name when available and otherwise falls back to hexadecimal numeric references.
- Use Strict entity syntax to require both the leading ampersand and trailing semicolon during decoding.
- Check Paste targets before copying into an attribute, JavaScript, CSS, or a URL component.
Interpreting Results:
Preferred HTML is a source representation, not a different character. Confirm the Resolved text, Unicode sequence, and UTF-8 bytes when exact identity matters. A named form and its numeric alternatives should resolve to the same code-point sequence.
- Direction review shows whether Auto detect chose encode or decode.
- Source review flags a bare name, missing semicolon, or extra literal text that was accepted for exploration but should not be copied as canonical source.
- Paste targets applies destination-specific escaping. Use the row for the actual destination instead of the shortest source form.
- The result covers one resolved value. It does not validate or sanitize the surrounding HTML document, script, style sheet, or URL.
Technical Details:
HTML defines named, decimal numeric, and hexadecimal numeric character references. Unicode scalar values range from U+0000 through U+10FFFF but exclude the surrogate range U+D800–U+DFFF. One resolved value may contain up to 64 scalar values.
Transformation Core:
The transformation first resolves the input to Unicode text. Every output form is then derived from that same code-point sequence, which keeps HTML, Unicode labels, UTF-8 bytes, and destination escapes comparable.
| Stage | Rule | Result |
|---|---|---|
| Direction | Entity-shaped text and bare catalog names decode; code-point notation and literal symbols encode. | Encode or decode path |
| Resolution | Named references use an exact case-sensitive catalog match. Numeric references are parsed in base 10 or 16 and checked as Unicode scalar values. | Unicode text and code points |
| HTML projection | Each code point becomes decimal and hexadecimal syntax; a named form is used only when every resolved character has a catalog name. | Named, decimal, and hexadecimal source |
| Destination projection | The same text is escaped for HTML text, quoted or unquoted attributes, JavaScript, CSS, and one URL component. | Context-specific paste forms |
| Length comparison | ASCII source characters are counted after projection. | Named versus numeric source lengths |
Parsing and Context Rules:
- Strict decoding requires
&name;,{, or{form with a leading ampersand and trailing semicolon. - Relaxed decoding also accepts a bare known name or a missing semicolon, then marks the source as legacy or shortened.
- A literal-text encode path uses the first grapheme. Additional literal text is not included and is flagged in the source review.
- Code-point notation accepts tokens separated by spaces or commas, including
U+,0x, decimal, and semicolon-terminated numeric-reference forms. - An unquoted attribute is rejected when the resolved text contains whitespace, quotation marks, apostrophe, equals sign, angle brackets, or grave accent.
Worked Transformation:
Decoding © resolves to © at U+00A9. The same scalar becomes © in decimal HTML, © in hexadecimal HTML, and bytes C2 A9 in UTF-8. These strings differ in source length but preserve the same Unicode value.
Accuracy and Privacy Notes:
The lookup uses a local entity catalog and deterministic encoding rules in the browser. It does not send the entered entity or character to a lookup provider.
- Entity names are case-sensitive, and named-first output reflects the local catalog's preferred alias rather than every standard alias.
- The attribute-context switch records the source context for review; it does not reproduce the full HTML parser or sanitize surrounding markup.
- JavaScript, CSS, and URL output rows are syntax projections for one value. Quoting, concatenation, and document-level security still need separate review.
References:
- HTML Standard: Character references, WHATWG Living Standard.
- HTML Standard: Named character references, WHATWG Living Standard.
- The Unicode Standard, Chapter 3, Unicode Consortium, Unicode 17.0.0.