Invalid XML Character Reference – Fix Numeric Entity Errors

Local only

An invalid character reference points to a code point that XML cannot represent or that falls outside the valid Unicode range.

23 chars · 1 line

Waiting for input

Loading XML parser…

XML character references

How to fix an invalid XML character reference

The sample uses hexadecimal code point 110000, which is beyond Unicode's highest code point U+10FFFF. Numeric syntax alone is not enough; the referenced character must also be permitted by XML. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • XML well-formedness validation
  • Broken XML example preloaded
  • Corrected XML comparison
  • .xml file import
  • Browser parser feedback
  • Browser-local processing

Steps

  1. Identify the full numeric reference beginning with &# or &#x.
  2. Convert or look up the referenced code point and verify it is valid for XML.
  3. Replace the bad value with the intended valid code point and validate the complete document again.

Numeric syntax can still reference an impossible character

A parser validates both the reference syntax and its resulting Unicode scalar value. Values above U+10FFFF and disallowed control characters cannot be made valid simply by writing them numerically.

Check data encoders that generate references

Repeated invalid references often originate in custom serializers that emit unchecked integers. Fix the encoder so future XML is generated with valid Unicode values.

Out-of-range XML character reference

Replace an impossible code point with a valid Unicode reference.

Invalid XML

<root>&#x110000;</root>

Corrected XML

<root>&#x1F600;</root>

Common questions

Frequently asked questions

What is the largest Unicode code point?

Unicode code points end at U+10FFFF.

Can any Unicode number appear in XML as a numeric reference?

No. XML also restricts some character ranges, so the referenced code point must be allowed by the applicable XML version.

Are hexadecimal XML character references allowed?

Yes. They use the form &#x...; and must still resolve to a valid character.

Debugging a specific XML issue? Browse XML troubleshooting.