Diagnose numeric references without rendering HTML
Numeric character references such as A and A describe a number using decimal or hexadecimal digits. This scanner reports each matching reference, its zero-based UTF-16 offset, its base, Unicode scalar validity, the HTML result code point and any parse-error labels. It does not replace the surrounding text or render a document.
Reproduce the example
Load the example and press Inspect. The six matches represent A, a smiling face, a legacy control reference, a null reference, a surrogate reference and A without a final semicolon. Their resulting code points are U+0041, U+1F600, U+20AC, U+FFFD, U+FFFD and U+0041. The last row includes missing-semicolon. The table shows the first 200 matches; expand the JSON report or download all matches. Download JSON to preserve the original reference strings and diagnostic fields.
Unicode validity and HTML behavior differ
A Unicode scalar excludes surrogate values and numbers beyond U+10FFFF. Null is a scalar, yet HTML replaces a null reference. HTML also remaps certain legacy control values, including decimal 128 to the euro sign. Noncharacters produce a diagnostic but remain unchanged; some controls likewise remain controls. Consequently, a displayed character alone is not enough to determine whether the reference is conforming. The numeric code point and issue list remain useful when a result is invisible.
The implementation follows the numeric-reference end-state rules in the WHATWG HTML parsing specification. These are HTML rules, not XML rules.
Scope and troubleshooting
This is a context-free text scan. It finds numeric-looking references even inside comments or script text, where an actual HTML tokenizer may treat them differently. Named entities are not included. A malformed sequence with no digits, such as &#x;, produces no row; zero matches does not mean the source is valid HTML. Missing semicolons are accepted as matches and flagged. Digits stop at the first character outside the selected number base.
Input is limited to 100,000 UTF-16 units and 2,000 matches. Huge digit sequences are classified as outside the Unicode range without constructing an enormous integer. Input is never inserted into the DOM, and no resource URLs are visited. For document structure rather than character references, try the HTML heading outline viewer.





