Overview
Introduction
This tool reverses numeric HTML character references, whether written in decimal (A) or hexadecimal (A) form, back into their plain integer Unicode code points.
It's useful when you have markup or text containing entities and want to know exactly which characters they represent.
What Is HTML Entity to Integer Converter?
A converter that takes a list of numeric HTML entities, one per line, and outputs the integer code point each one represents.
It accepts both the decimal (&#N;) and hexadecimal (&#xHHH;) numeric entity syntaxes defined by HTML and XML.
How HTML Entity to Integer Converter Works
Each line is matched against a pattern recognizing either &#digits; or &#xhexdigits; (case-insensitive).
The numeric portion is parsed with the appropriate radix (10 for decimal, 16 for hex) to get the code point.
The result is validated against the full Unicode range and checked to exclude the UTF-16 surrogate band before being reported.
When To Use HTML Entity to Integer Converter
Use it to decode entities found in HTML/XML source, such as when debugging garbled or escaped text.
It's also useful for confirming exactly which character a given entity represents.
Often used alongside Integer to HTML Entity Converter and Integer URL Decoder.
Features
Advantages
- Handles both decimal and hexadecimal numeric entity syntaxes in the same input list.
- Validates the decoded code point range, catching malformed or invalid entities.
Limitations
- Doesn't support named entities (like & or ©); only the numeric forms.
- Requires the full entity syntax including the leading &# and trailing semicolon.
Examples
Best Practices & Notes
Best Practices
- If your source text mixes named and numeric entities, convert named ones to numeric form first (or strip them) before using this tool.
Developer Notes
A single regular expression, `/^&#(x[0-9a-fA-F]+|[0-9]+);$/`, captures both entity forms in one pass, and the captured group's leading "x"/"X" determines whether `parseInt` is called with radix 16 or 10.
HTML Entity to Integer Converter Use Cases
- Decoding numeric HTML entities found in scraped or escaped text
- Verifying which character a given &#N; or &#xN; entity represents
- Checking round-trip correctness against the Integer to HTML Entity Converter
Common Mistakes
- Omitting the trailing semicolon, which is required for the entity to match.
- Expecting named entities like & to be decoded; only numeric forms are supported.
Tips
- Use the companion Integer to HTML Entity Converter to generate valid test entities in either form.