NIF, NIE, CIF and IBAN validator

Quick answer

Type a Spanish NIF, NIE, CIF or an IBAN and this tool instantly checks whether its control letter or digit is correct, detecting the type automatically. It runs entirely in your browser: nothing is sent to any server. It checks the format, not whether the number exists or is active.

A NIF, a NIE, a CIF and an IBAN all carry a small safety mechanism inside them: a final letter or digit calculated from the rest of the characters. This tool recognises which of the four you have typed and recomputes that control character to tell you whether the number is well formed. Everything happens inside your browser, with nothing sent to any server.

It helps to understand what a valid result does and does not mean. The tool checks the maths of the number, it does not query any register: a NIF with the right letter may belong to nobody, and a VAT number with a perfect format may not be registered in VIES (the EU VAT database). It is built to catch typos before they end up on an invoice or in the modelo 036 (the Spanish tax registration form), not to confirm that a person or a company actually exists.

All the calculation happens in your browser. We never store or send what you type.

The BIC/SWIFT shown is the bank's general code. For an international transfer, confirm it with your bank: some use a different BIC per branch or purpose. We detect the bank from the IBAN's entity code; we do not check whether the account exists.

What the tool checks (and what it does not)

A NIF, a NIE, a CIF and an IBAN are not random strings: the last character (a letter or a digit) is calculated from the others with a fixed formula. This tool redoes that calculation and compares the result with what you typed. If they match, the number is well formed; if not, there is a typo somewhere.

That check is purely mathematical: it does not query any register. It does not ask the Agencia Tributaria (the Spanish tax agency) whether the NIF belongs to anyone, your bank whether the account exists, or VIES whether a VAT number is registered. An identifier can have a perfect control character and still match no real person, company or account, or be deregistered. Valid format means no typos, not exists and is active.

And because the whole calculation runs inside your browser, your data never travels to a server: you can check a client's NIF or your own IBAN without that number leaving your computer. That is the difference between validating the format (private, instant) and verifying existence (which requires querying an official register).

NIF, NIE and CIF: which is which and what they are for

All three are your tax identifier in Spain, the key the tax office knows you by. They change depending on who you are:

You need to know which is yours (and your clients') in almost every procedure: when issuing an invoice, when registering with the modelo 036 (the tax registration form), when filing your taxes. To invoice clients in other EU countries without VAT you will also use your NIF-IVA, which is your NIF or NIE with the ES prefix, once you have registered in the ROI (the register of intra-EU operators); we cover it in the modelo 349 guide.

In kontora, when you add a client, the app checks the format of their NIF, NIE or CIF so a typo does not slip onto the invoice; confirming that the client exists and is active is still up to you.

The IBAN and its mod-97 check

The IBAN is the international number of your bank account. In Spain it has 24 characters: the ES prefix, two check digits and the twenty digits of the usual account number (bank, branch, internal check and account). The two check digits are computed with the mod-97 method: the IBAN is rearranged, the letters are turned into numbers, and the remainder of dividing by 97 must be exactly 1. A single mistyped digit breaks that sum, and the validator catches it.

You will have to type your IBAN correctly at moments where a slip costs money: when setting up a direct debit (domiciliación) for your taxes or your autónomo (self-employed) quota, or when giving the account for a refund. Here the mod-97 check is your safety net against a transposed digit.

The same mod-97 method works for IBANs from any country, but the length varies (not all have 24 characters), so a well-formed foreign IBAN will have the length used in its own country.

Common mistakes when typing an identifier

Frequently asked questions

Does this tool check whether the NIF or IBAN really exists?
No. It only recomputes the control character and tells you whether the number is well formed. An identifier with the right format may belong to nobody or be deregistered; to confirm that, you have to query the relevant official register.
Is my data sent to any server?
No. The whole calculation runs inside your browser, and the number you type never leaves your computer, so you can check someone's NIF or your own IBAN safely.
How do I know whether I have a NIF or a NIE?
Look at the first character: if it is the letter X, Y or Z, it is a NIE (the foreigner's ID); if it is a digit, it is a NIF matching the DNI. Foreigners in Spain normally hold a NIE.
Does the validator confirm my client is registered in VIES?
No. It checks the format of a VAT number, but not its VIES registration. You confirm that in VIES itself, on the tax agency website, before issuing an invoice without VAT.
Does it work for IBANs from other countries?
Yes, the mod-97 method is international and works for any IBAN. But the length depends on the country (24 characters in Spain), so a correct foreign IBAN will have the length used in its own country.
How do you know which bank my IBAN belongs to, and is the BIC reliable?
From the entity code: the four digits right after ES and the two check digits identify the bank. The BIC/SWIFT we show is that bank's general one; for an international transfer, confirm it with your bank, as some use a different BIC per branch or purpose.

Rather have this calculated for you?

kontora generates your tax forms box by box, tells you how much to set aside and reminds you before every deadline.

Pricing · Calculators