CIF validator

Validate the CIF of a Spanish company, see its entity type and the right check character, and generate fictitious CIF numbers for testing.

One per line, up to 1000. A DNI, an NIE and tax IDs of people (K, L and M) are never stored.

Waiting for input

Type a CIF (B65410011) and it is checked right away.

How it works

What it checks

A CIF (the tax ID of a Spanish company or entity) has three parts: a letter for the legal form (B for a limited company, A for a public limited company, G for an association…), seven digits and a check character. The check comes from the seven digits: the even positions are added, the odd ones are doubled and their digits added, and the complement to 10 of the total is the check. When the entity takes a letter, that digit is mapped through the table JABCDEFGHI.

Some entities always take a digit (A, B, E and H), others always a letter (N, P, Q, S and W) and the rest accept both. The validator is strict only where the official sources agree, and when it fails it tells you which check it expected and in which form.

Tax IDs of people and test data

Tax IDs starting with K, L or M do not belong to companies but to people without a DNI (children under 14, Spaniards living abroad and foreigners without an NIE). They are checked with the DNI letter table and, being personal data, they are never stored in the browser even with “Remember what I type” on. The same happens if you paste a DNI or an NIE by mistake: as soon as one line looks like one, nothing you type is stored.

The Generate tab creates CIF numbers with the right check for the type you choose, handy for test invoices and forms. They are random: a valid CIF does not mean the company exists.

FAQ

What is the difference between CIF and NIF?

Since 2008 the official name is NIF for everyone, people and companies. “CIF” is still used for the tax ID of entities, which starts with a letter that tells the legal form.

Does a valid CIF mean the company exists?

No. It only means the check character matches the digits. To know whether a company is registered you have to look it up in the Spanish Tax Agency census.

↑ ↓ to move, Enter to open, Esc to close

Keyboard shortcuts

Ctrl K/
Search tools
c
Copy the main result
1 … 9
Switch tab
?
Show this help