Northern Ireland (XI)

Northern Ireland VAT Number Validation

Format, pattern, and MOD 97 checksum algorithm for XI VAT numbers

Northern Ireland VAT numbers use the XI prefix introduced after Brexit to identify businesses in Northern Ireland that trade with the EU under the Northern Ireland Protocol.

Format vs. Active Validation

This checks format only, not if a VAT number is really registered. Use VatDB's API to verify is a number is really registered and active. VatDB checks official EU and national datasources.

Format Overview

Property Value
Country Code XI
Format 9 digits, 12 digits, or GD/HA + 3 digits
Length 5, 9, or 12 characters after XI
Examples XI123456789, XI123456789012, XIGD001, XIHA001

Regex Pattern

^XI([0-9]{9}|[0-9]{12}|GD[0-9]{3}|HA[0-9]{3})$

When is XI Used?

  • Post-Brexit identifier for Northern Ireland businesses
  • Used for intra-EU trade under the Northern Ireland Protocol
  • Businesses may have both GB and XI VAT numbers

Checksum Algorithm (MOD 97 - GB variant)

XI uses the same validation as GB VAT numbers:

def validate_xi_vat(number):
    if number.startswith('XI'):
        number = number[2:]

    if number.startswith(("GD", "HA")):
        return True  # accepted special XI formats

    if len(number) not in (9, 12) or not number.isdigit():
        return False

    if len(number) == 12:
        # First 9 digits are the main number, last 3 are branch
        number = number[:9]

    weights = [8, 7, 6, 5, 4, 3, 2]
    total = sum(int(d) * w for d, w in zip(number[:7], weights))

    # Check with standard offset
    if total % 97 == 0:
        return True

    # Check with 55 offset (alternative valid format)
    if (total + 55) % 97 == 0:
        return True

    return False

Frequently Asked Questions

How do I verify a Northern Ireland VAT number (XI)?
XI VAT numbers use MOD 97 validation (GB algorithm) for numeric 9/12-digit formats. Special GD/HA formats are accepted as valid XI structural formats; for active status validation, use VatDB.
What does a Northern Ireland VAT number look like?
A Northern Ireland VAT number can be XI123456789 (9 digits), XI123456789012 (12 digits with branch code), or special forms like XIGD001 / XIHA001.
How many digits are in a Northern Ireland VAT number?
Most XI numbers are 9 or 12 digits, but special GD/HA formats use 5 characters after XI.
Why was the XI prefix created for Northern Ireland?
After Brexit, Northern Ireland needed a distinct VAT identifier for EU trade under the Northern Ireland Protocol. XI distinguishes these from GB (Great Britain) numbers.
What's the difference between XI and GB VAT numbers?
XI numbers are for Northern Ireland businesses trading with the EU under the Protocol. GB numbers are for Great Britain (England, Scotland, Wales). A Northern Ireland business may have both.
Where can I check a Northern Ireland VAT number?
Use VatDB's API for instant VAT validation against official EU and national databases. XI numbers are treated as EU numbers for trade purposes.
Can a business have both XI and GB VAT numbers?
Yes, a Northern Ireland business trading with both the EU and GB may have both an XI number (for EU trade) and a GB number (for UK domestic purposes).
What's the difference between format validation and checking if a VAT number is active?
Format validation confirms structural validity, but registrations can change. A formatted number might not be actively registered for EU trade. VatDB verifies current status.

Validate Northern Ireland VAT Numbers Instantly

Use our API for real-time XI VAT number validation

Try Free