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:
- NIF (Número de Identificación Fiscal, the Spanish tax ID): the one for Spanish individuals. It matches the DNI (national ID card): eight digits and a final control letter (the one produced by the remainder of dividing the number by 23).
- NIE (Número de Identidad de Extranjero, the foreigner's ID number): the one for non-Spaniards. It starts with X, Y or Z, followed by seven digits and a control letter computed just like the NIF's. If you are a foreigner working in Spain, your NIE acts as your NIF for every purpose.
- CIF (the company tax ID): the one for legal entities such as an SL (the Spanish limited company). It is a letter for the entity type, seven digits and a control character that, depending on the type, is a digit or a letter. Since 2008 it is officially called the NIF of the legal person, but the name CIF and its format are still in everyday use.
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
- Confusing NIF and NIE: if the number starts with a letter (X, Y or Z) it is a NIE; if it starts with a digit, it is a NIF. Putting one where the other belongs is the most common slip among newcomers.
- Copying the IBAN with spaces: banks show it in groups of four to make it easier to read. This tool ignores the spaces, but some official forms do not, so paste it without them if you get an error.
- Swapping a 0 for an O or a 1 for an I: the IBAN has no letters except the country prefix; if you see an O in the middle, it is a misread zero.
- Forgetting or mistyping the final letter of the NIF or the NIE: it is exactly the character the validator recomputes, so a slip there shows up straight away.
- Assuming valid equals active: to repeat, a correct format does not confirm that the identifier exists or is registered; for that you have to check the relevant official register.
Frequently asked questions
Does this tool check whether the NIF or IBAN really exists?
Is my data sent to any server?
How do I know whether I have a NIF or a NIE?
Does the validator confirm my client is registered in VIES?
Does it work for IBANs from other countries?
How do you know which bank my IBAN belongs to, and is the BIC reliable?
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.