Validate Czech VAT Numbers (DIČ, CZ Prefix) in Node.js
4 Dec 2026

A Czech VAT number is CZ followed by 8, 9 or 10 digits, and the length tells you who holds it. Eight digits is a company’s IČO. Nine or ten digits can be a person’s birth number, which makes the field personal data. This post covers the Node.js side: normalising the input, the format check, the IČO check digit, the VIES lookup, and how the ARES register fits in. For the general behaviour of the endpoint, see the Czech Republic VAT API reference.
What a Czech VAT number looks like
The Czech VAT checker takes the daňové identifikační číslo (DIČ), which looks like this:
CZ– the VIES country prefix, which is also the ISO 3166-1 code- 8, 9 or 10 digits – the body of the number
The shape depends on the holder:
- 8 digits – a legal entity. The body is the IČO (identifikační číslo osoby), the number the entity has in the Czech business register.
- 9 or 10 digits – usually a natural person. The body may be based on the person’s rodné číslo (birth number).
- VAT group – a VAT group registers under a number of its own. A member company’s own number is not the group’s number.
The length rules and the checksums below come from the open-source python-stdnum reference implementation, not from a statute, so treat them as a well-documented convention. The tax authority can also issue an individual an identifier other than the birth number, so don’t assume every 9- or 10-digit number is one.
What the number is not:
- Not the IČO itself. For a legal entity the DIČ contains the IČO, but a company can have an IČO and no DIČ. Having an IČO says nothing about VAT registration. The company number vs VAT number post covers the general case.
- Not a verdict. A well-formed
CZnumber can belong to nobody. Format and registration are separate questions, as format vs valid explains.
Step 1: format validation in Node.js
Reject malformed input before any network call. The regex matches the pattern the vatnode API enforces, CZ plus 8 to 10 digits:
const CZ_VAT_PATTERN = /^CZ\d{8,10}$/
function normaliseCzechVatId(
input: string,
opts: { mode?: 'strict' | 'lenient' } = {}
): string | null {
let cleaned = input.replace(/[\s.\-/]/g, '').toUpperCase()
// Lenient mode: prepend CZ when the user typed only the digits
if (opts.mode === 'lenient' && /^\d{8,10}$/.test(cleaned)) {
cleaned = `CZ${cleaned}`
}
return CZ_VAT_PATTERN.test(cleaned) ? cleaned : null
}
// Strict (default) – API consumers should send a fully-qualified ID
normaliseCzechVatId('CZ 1234 5678') // → 'CZ12345678'
normaliseCzechVatId('12345678') // → null
// Lenient – for checkout forms where customers paste only the digits
normaliseCzechVatId('12345678', { mode: 'lenient' }) // → 'CZ12345678'
// Too short for the pattern
normaliseCzechVatId('CZ1234567') // → null
The pattern is deliberately loose. It does not check the check digit and does not tell a company from a person. A string that matches is well-formed input, nothing more. To see what VIES returns for a real number, paste it into the VAT checker. To call it from code, a free API key takes a minute and the quickstart has the first request.
Step 2: the IČO check digit (a soft signal)
An 8-digit body has a check digit, which makes a cheap local filter for typos. The algorithm, as documented in python-stdnum:
- Take the first seven digits and multiply them by the weights
8, 7, 6, 5, 4, 3, 2. Add up the products. - Compute
11 − (sum mod 11), then take that modulo 11. - A result of 0 becomes 1, a result of 10 becomes 0.
- The result must equal the eighth digit.
const ICO_WEIGHTS = [8, 7, 6, 5, 4, 3, 2]
function icoCheckDigit(first7: string): number {
let sum = 0
for (let i = 0; i < 7; i++) {
sum += Number(first7[i]) * ICO_WEIGHTS[i]
}
const c = (11 - (sum % 11)) % 11
return (c || 1) % 10
}
function hasValidIcoChecksum(body: string): boolean {
if (!/^\d{8}$/.test(body)) return false
return icoCheckDigit(body.slice(0, 7)) === Number(body[7])
}
// 12345678: first seven digits 1234567
// 1*8 + 2*7 + 3*6 + 4*5 + 5*4 + 6*3 + 7*2 = 112
// 112 mod 11 = 2, so (11 - 2) mod 11 = 9
icoCheckDigit('1234567') // → 9
hasValidIcoChecksum('12345678') // → false (the last digit is 8, not 9)
12345678 is a synthetic number used throughout this post, and it fails the checksum on purpose. This check applies to 8-digit numbers only. Nine- and ten-digit bodies follow other rules (for a person they depend on the birth date), so a generic Czech validator should skip the IČO check for them rather than reject them. A passing checksum says the digits are internally consistent. It says nothing about whether the entity exists or is VAT-registered. Treat a failed checksum as a reason to ask the customer to re-check the input, and a passed one as permission to continue to the real lookup. The vatnode API does not run this checksum. It validates the pattern from Step 1 and leaves the verdict to the registries.
Step 3: VIES for the Czech Republic
Format-valid input goes to VIES, which routes a CZ query to the Czech node and relays back one of:
- A valid or invalid answer. The trader name and address usually come with it but are not guaranteed.
MS_UNAVAILABLEorMS_MAX_CONCURRENT_REQ– the Czech node is down or saturated.SERVICE_UNAVAILABLEorGLOBAL_MAX_CONCURRENT_REQ– VIES itself is degraded or overloaded.- A timeout, if the node doesn’t answer in time.
When nothing else answers, the vatnode API surfaces the last three as its own VIES_UNAVAILABLE or UPSTREAM_TIMEOUT codes (see Error handling below), not VIES’s raw fault strings.
Only a VIES answer can carry a consultation number, and only when your request includes a requester VAT number and VIES issues one. The consultation number explainer covers what it is and what it is not. Every member-state node goes down sometimes, so read the VIES downtime guide before you design the unhappy path. A VIES valid tells you the number is active in VIES at that moment. It does not decide whether reverse charge or a zero rate applies, which also depends on the transaction and your evidence.
Step 4: the ARES register
ARES is the Czech Republic’s register of economic entities, run by the Ministry of Finance. It is free, needs no key, and its record for an IČO includes the VAT register status (stavZdrojeDph). vatnode reads that field and treats AKTIVNI as valid: true. Every other state, and an IČO ARES does not know, gives valid: false.
vatnode uses ARES in two ways, and only for 8-digit numbers. ARES is looked up by IČO, so a 9- or 10-digit number can’t be asked there, and VIES stays the only source for it.
When no requester VAT is set, a single live check asks VIES and ARES at the same time:
- If ARES returns a usable answer first, that answer wins. A
valid: falsefrom ARES wins too and is returned as the result, withsourceARES_CZ. Avalid: trueis not accepted when ARES shows a VAT-group registration for the IČO, and the check waits for VIES. - If ARES errors or times out, vatnode waits for VIES.
- If VIES fails with a transient error (
MS_UNAVAILABLE,MS_MAX_CONCURRENT_REQ,TIMEOUT,SERVICE_UNAVAILABLEorGLOBAL_MAX_CONCURRENT_REQ), the ARES answer is the fallback. If ARES can’t answer either, you get the VIES error back.
When a requester VAT is set in dashboard Account details, ARES is not used for the verdict at all. The Czech node can be slow, and the check waits for it, because only VIES issues a consultation number and an ARES answer would silently drop it.
What an ARES_CZ response means:
validis ARES’s VAT-register flag. It says ARES lists the entity as an active VAT payer now. VIES has not confirmed anything.companyName,companyAddress,companyRegistrationDate,companyFormandcompanyStatuscome from ARES’s record (any of them can benull).consultationNumberisnull, always.
A fallback valid is not a VIES confirmation. It is a national registry result, and the two can disagree. A positive ARES answer is therefore a reason to proceed provisionally, not to stop checking. A valid: false means ARES doesn’t list the entity as an active VAT payer at that moment. It does not prove the number is invalid in VIES. VIES vs national VAT databases explains why the two answers are different questions, and why VIES says a valid number is invalid covers the reverse situation.
There are three ways to cover the Czech case, fastest first:
- Use vatnode. It already runs VIES CZ plus the ARES path above, labels every result with its
source, and returns the consultation number when a requester VAT is set. Free for low volume – 100 checks a month, no card – with paid plans on pricing above that. Register and the ARES logic stops being your problem. - Queue retries against VIES without a register. Simplest to write. Fine only if your flow can tolerate a ‘we’ll get back to you’ UX.
- Build the ARES integration yourself. That means handling the IČO lookup, the VAT-group flag, the 8-digit limit, and the ARES-vs-VIES mismatch in your own code. Doable, but it is code you keep maintaining.
ARES enrichment on a VIES success
ARES is also used the other way round. When VIES answers successfully for an 8-digit number, vatnode makes a best-effort call to ARES to add company data VIES does not provide:
companyRegistrationDate– the date the entity was established, from whichcompanyAgeYearsis derived.companyForm– the legal form. Where the Czech legal form code is in vatnode’s lookup table it is mapped to an English label, such asLimited liability company (s.r.o.).companyStatus– the VAT register state, normalised toactive,ceasedorinactive(an unrecognised ARES state is passed through in lowercase).
Any of them can be null. The enrichment never changes valid or source: the verdict still comes from VIES. The set of countries with a national fallback or enrichment changes over time, so the current list is at /docs/coverage.
Full working example with the vatnode API
const res = await fetch('https://api.vatnode.dev/v1/vat/CZ12345678', {
headers: { Authorization: `Bearer ${process.env.VATNODE_API_KEY}` },
})
if (!res.ok) {
const { error } = await res.json()
throw new Error(`VAT check failed: ${error.code}`)
}
const data = await res.json()
// {
// "valid": true,
// "vatId": "CZ12345678",
// "countryCode": "CZ",
// "companyName": "UKÁZKOVÁ SOFTWARE S.R.O.", // typically present, not guaranteed
// "companyAddress": "Ukázková 1, Praha, 11000", // same
// "companyRegistrationDate": "2012-03-02", // ARES enrichment, can be null
// "companyForm": "Limited liability company (s.r.o.)", // can be null
// "industryDescription": null,
// "registryCode": "12345678",
// "registryCodeName": "identifikační číslo",
// "taxId": "CZ12345678",
// "taxIdName": "daňové identifikační číslo",
// "registryPrivacy": false,
// "commercialName": null,
// "companyStatus": "active", // ARES enrichment, can be null
// "secondaryActivities": [],
// "companyAgeYears": 14,
// "website": null,
// "verifiedAt": "2026-12-04T08:30:00.000Z",
// "checkId": "019d2a89-a5d9-7b97-b710-57b84604de2b",
// "countryName": "Czech Republic",
// "countryVat": { "vatNumberFormat": "CZ + 8–10 digits", "vatNumberPattern": "^CZ\\d{8,10}$", ... },
// "consultationNumber": "WAPIAAAAX...", // only when a requester VAT is set (dashboard → Account details)
// "specialTerritory": null,
// "source": "VIES"
// }
CZ12345678 is the synthetic number from Step 2, so the values above are illustrative: they show the response shape for a valid Czech check, not what VIES says about this number. registryCode is the IČO and taxId the DIČ, both derived from an 8-digit number. For a 9- or 10-digit number both stay null, because the digits are not an IČO.
The field that matters for your logic is source. Branch on whether it is VIES, not on whether it is ARES_CZ:
type CzVerdict = 'confirmed' | 'rejected' | 'provisional' | 'unconfirmed'
function classifyCzechCheck(data: { valid: boolean; source: string }): CzVerdict {
if (data.source === 'VIES') {
return data.valid ? 'confirmed' : 'rejected'
}
// ARES_CZ, and also CACHE: a cache hit reports source "CACHE" and
// does not say which source produced the cached answer
return data.valid ? 'provisional' : 'unconfirmed'
}
Results are cached for 15 minutes when valid and 5 minutes when invalid, and a cache hit reports source: "CACHE" with a null consultation number. CACHE hides where the answer came from, so treat anything other than VIES as provisional in your own logic: re-check after the cache window, or set a requester VAT in Account details. With a requester set, cache reads are skipped and every check is a fresh VIES call. Without one, a re-check of an 8-digit number can return ARES_CZ again, so don’t rely on the result for reverse charge until it comes back as confirmed. What a provisional result means for the order and the invoice is a decision for you and your tax adviser. This article is informational, not legal or tax advice.
Test keys (vat_test_ prefix) accept only the reserved XX fixture numbers and successful test responses carry source: "VIES", so they won’t produce an ARES_CZ or CACHE result. Cover those two branches with a mocked response in your unit tests; the fixtures are listed in test mode.
What to store, and personal data for individuals
For every check, store the checkId, verifiedAt, valid, source and, when present, the consultationNumber, plus the name and address the response returned. The source is what lets you tell a VIES confirmation from a provisional one months later. The audit trail guide covers what an auditable record looks like, and national tax ID from a VAT number explains what taxId is and is not.
For a sole trader or other natural person, the 9- or 10-digit body may be based on their birth number, and the name attached to it is their own. Treat that number as personal data under the GDPR. Czech law (Act 133/2000, § 13c) also restricts when a birth number may be used at all, so take advice before you keep it. Collect it only where you need it, keep it out of logs and analytics, and give it its own retention period instead of inheriting a default.
Error handling
The vatnode API returns explicit error codes:
INVALID_FORMAT(400) – the string isn’t a well-formedCZVAT ID. Your input; surface it inline, don’t retry.INVALID_REQUESTER(422) – your configured requester VAT number was rejected by VIES. Fix it in dashboard Account details.RATE_LIMITED(429) – you’ve spent your quota on a plan without overage. Retryable on a longer horizon, or see pricing for plans with more requests.VIES_UNAVAILABLE(503) – the Czech node (or VIES itself) is down and no fallback answered. Transient – queue a retry, never mark the number invalid.VIES_ERROR(502) /UPSTREAM_TIMEOUT(504) – transient upstream faults. Retry with backoff. With a requester VAT set, a 502VIES_ERRORis also what you get when VIES answeredvalidbut issued no consultation number; that request isn’t counted against your quota and is safe to retry.VIES_ERROR(403) – VIES reports the VAT ID or vatnode’s IP as blocked (VAT_BLOCKED/IP_BLOCKED). Not a verdict on the number, but not transient either – don’t retry in a loop; alert and review.AUDIT_WRITE_FAILED(502) – the check ran but its audit row couldn’t be stored, so nocheckIdwas issued. Not billed, safe to retry.INTERNAL_ERROR(500) – retry, alert if it persists.
Without a requester, an 8-digit number can resolve into an ARES_CZ answer rather than an error, so your code needs the source branch above as much as the error branch. A 9- or 10-digit number never reaches ARES, so a VIES outage gives you VIES_UNAVAILABLE (or UPSTREAM_TIMEOUT on a timeout), and so does any check with a requester set. Retry with exponential backoff (500ms, 2s, 5s), then queue the check for a background re-run rather than blocking checkout. Full code reference at /docs/errors; retry table in handling VIES error codes. For the wider pattern of designing around VIES, see the VIES alternative guide and the Node.js VAT validation guide.
FAQ
What does a Czech VAT number look like?
It is the prefix CZ followed by 8, 9 or 10 digits, the DIČ (daňové identifikační číslo). For a legal entity the digits are its 8-digit IČO. A 9- or 10-digit number can be based on a person’s birth number, which is personal data. vatnode accepts the pattern CZ plus 8 to 10 digits and rejects anything else as INVALID_FORMAT. A match means the string is well-formed, not that the business is VAT-registered.
How do I check a VAT number for the Czech Republic?
Normalise the string, check the format, then query VIES, which is the only source that can issue a consultation number. When no requester VAT is set, vatnode may answer an 8-digit number from the Czech ARES register instead, if that answer arrives first or VIES fails. The response labels it source ARES_CZ, carries no consultation number and is not a VIES confirmation. With a requester VAT set, only VIES is used.
Is the Czech DIČ the same as the IČO?
For a legal entity the DIČ is CZ plus its 8-digit IČO, so the digits match. They are still different identifiers. The IČO is the register number and the DIČ is the VAT number, and a company can hold an IČO without being VAT-registered. A natural person’s DIČ may be based on a birth number rather than an IČO.
Validate Czech VAT numbers without wiring up ARES yourself
One call runs the VIES check for the Czech Republic and labels the result with its source. Without a requester VAT it can answer from ARES when that arrives first or VIES fails. With a requester VAT configured, it returns the consultation number. Free plan, 100 requests/month.
Get a free API key · API reference · Czech Republic VAT API reference