Skip to content

Spanish NIF, NIE & CIF checker

Verify Spanish DNI/NIF, NIE and corporate CIF tax numbers in bulk using official Agencia Tributaria check-character rules.

Checks official format and check digits locally in your browser. Does not query live government or banking registries, so active registration and account ownership are not confirmed. Enter one number or paste up to 1,000 numbers (one per line).

How to use Spanish NIF, NIE & CIF checker

  1. Paste one or more Spanish tax IDs. Enter DNI/NIF, NIE, or corporate CIF numbers into Spanish NIF, NIE or CIF number or list (up to 1,000 lines), or click Load example.
  2. Run the local checksum check. Click Check numbers to strip ES prefixes and punctuation, verify Modulo-23 or CIF control characters, and inspect the decoded parts.
  3. Filter and copy single or batch results. Use Copy formatted or Copy compact for single entries, or switch between All, Passed, and Failed in batch mode.
  4. Download your audit table. Click Download results (CSV) or Download Excel (.xlsx) before preparing Facturae XML or VIES filings.

Everything you type stays in this browser on your device. Nothing is uploaded, and your saved details are never sent anywhere.

How does the Modulo-23 check letter work for Spanish DNI and NIE?

Spanish personal tax numbers verify integrity by dividing an 8-digit integer by 23 and mapping the remainder (0 through 22) to the official 23-letter sequence TRWAGMYFPDXBNJZSQVHLCKE. Any single-digit typo or adjacent digit transposition changes the remainder and fails the check immediately.

Under Spanish Real Decreto 1553/2005 on DNI Control Letter, the Ministry of the Interior applies this exact Modulo-23 lookup table to national identity cards and resident foreigner numbers alike.

Personal DNI numbers and X, Y, Z foreigner NIE prefixes

A standard DNI consists of 8 digits followed by one control letter, rejecting 00000000 as an invalid placeholder. For a foreigner NIE starting with X, Y, or Z followed by 7 digits, the validator substitutes 0 for X, 1 for Y, and 2 for Z to form an 8-digit integer before computing % 23.

When onboarding Central European vendors alongside Spanish contractors, you can also validate 10-digit Polish NIP tax numbers offline using the same local browser workflow.

Special personal NIF prefixes K, L, and M

The Spanish tax agency assigns K to minors under 14, L to Spaniards residing abroad without a DNI, and M to foreign nationals without an NIE. Each carries 7 serial digits and a trailing letter verified by Modulo-23 over those 7 digits, rejecting 0000000 bodies.

Adding a leading ES prefix converts any normalized 9-character NIF, NIE, or CIF into an 11-character EU VAT identifier suitable for cross-border Spanish invoices.

Corporate CIF control character rules and entity prefixes

Legal entities and unincorporated associations carry a 9-character identifier beginning with an entity-type letter (A through W), 2 provincial digits, 5 registration digits, and a final control character. The validator sums the digits at even positions (2, 4, 6) and adds the digit-sum of twice each digit at odd positions (1, 3, 5, 7), subtracting the units digit from 10 modulo 10.

According to Spanish Orden EHA/451/2008 on Entity NIF Structure, the initial entity prefix and provincial code determine whether that final character must be numeric (0 to 9) or alphabetic (JABCDEFGHI).

Entity prefix group Representative legal forms Allowed control character Example normalized format
A, B, E, H S.A., S.L., comunidades de bienes, homeowner boards Numeric digit (0 to 9) only B-1234567-4
N, P, Q, R, S, W Foreign entities, municipalities, public bodies, religious orders Alphabetic letter (J to I) only Q-2818002-D
00 provincial code Non-resident legal entities regardless of prefix Alphabetic letter (J to I) only A-0012345-E
C, D, F, G, J, U, V Cooperatives, associations, civil partnerships, joint ventures Either numeric digit or letter G-1234567-4
DNI / NIE / K, L, M Natural persons, sole traders (autónomos), non-residents Modulo-23 letter (TRWAGMYFPDXBNJZSQVHLCKE) 12345678-Z

If your finance team also processes Mediterranean vendor records, switch to the Italian Partita IVA checker to verify 11-digit Luhn checksums and provincial office codes.

Batch checking up to 1,000 Spanish tax IDs and Facturae prep

Pasting vendor master lists directly into Spanish NIF, NIE or CIF number or list lets accounts payable teams audit up to 1,000 numbers at once within the 50,000-character input limit. Results update immediately into a filterable table showing normalized strings, formatted hyphens, and pass or fail diagnostics.

Stripping ES prefixes and exporting clean CSV or Excel audits

The normalizer strips leading ES country codes, spaces, dots, and hyphens before running checksum math. In batch mode, toggle All, Passed, or Failed to isolate broken vendor records, then click Download results (CSV) or Download Excel (.xlsx) for spreadsheet sign-off.

Exported CSV files include a UTF-8 byte-order mark and defensive formula escaping, while Excel .xlsx workbooks are built in a local Web Worker at 0 KB network cost.

Pre-validating supplier IDs before Facturae XML billing

Under the EU VAT Directive 2006/112/EC, intra-community invoices require valid ES-prefixed VAT numbers for both issuer and buyer. Before submitting electronic invoices to Spanish public administrations, you can inspect Spanish Facturae e-invoice XML files in your browser to confirm matching tax IDs.

Offline checksum limits vs live AEAT census verification

Local Modulo-23 and CIF arithmetic executes with 0 bytes leaving your browser, making it safe for confidential payroll, customer onboarding, and supplier audits. However, a passing mathematical check digit proves structural validity only and cannot replace official registry queries.

What local validation catches without network exposure

Offline verification immediately detects missing characters, swapped adjacent digits, zeroed placeholder strings, and mismatched entity-prefix control types. Catching these formatting errors locally prevents rejected Facturae submissions and failed SEPA supplier onboarding imports.

Tip: Click Copy compact on single-number checks when pasting into ERP or EU VIES forms that reject hyphens, or Copy formatted for human-readable contracts and PDF invoices.

Informational scope and European supplier verification

This validator is provided for informational and operational convenience only and does not constitute tax or legal advice. Always verify active census status, VAT registration, and legal entity standing directly with the Agencia Tributaria (AEAT) or a qualified accountant, and retain supporting tax records for at least 4 years under Spanish tax audit rules.

For cross-border supplier audits extending into neighboring jurisdictions, you can also catch French supplier SIRET typos before European payouts using the same client-side batch workflow.

Questions

What is the difference between a Spanish NIF, NIE, and CIF?

NIF (Número de Identificación Fiscal) is the umbrella tax ID term in Spain. Individuals use an 8-digit DNI plus control letter, foreign residents use an NIE starting with X, Y, or Z, and companies use a 9-character corporate NIF formerly called CIF.

Which Spanish CIF entity prefixes require a letter instead of a digit?

Under Orden EHA/451/2008, corporate prefixes N, P, Q, R, S, and W, as well as any CIF with a 00 non-resident provincial code, require a letter from JABCDEFGHI. Prefixes A, B, E, and H require a numeric digit.

What do the K, L, and M prefixes mean on a Spanish NIF?

Agencia Tributaria issues K to Spanish resident minors under 14 without a DNI, L to Spanish citizens living abroad without a DNI, and M to foreign nationals without an NIE. All three validate using the 7-digit Modulo-23 table.

Does a valid CIF checksum confirm active AEAT registration?

No. Local Modulo-23 and CIF algorithms catch transcription typos, swapped digits, and invalid prefixes. Confirming active census status or VAT registration requires querying the Agencia Tributaria or the EU VIES portal.

How do I format a Spanish NIF as an EU VAT number?

Prepend ES directly before the normalized 9-character NIF, NIE, or CIF with no spaces or hyphens, such as ESB12345674. The single-number result card displays this EU VAT form ready to copy.

Are Spanish supplier tax IDs uploaded when running batch checks?

No. All normalization, Modulo-23 division, CIF digit summing, and Excel export run locally inside your browser with 0 bytes of tax data sent over the network.

Updated