🇪🇸 Spanish CIF Validator

Check a Spanish company tax ID (CIF, now called NIF de persona jurídica), identify the type of entity and calculate the control character. Everything runs locally in your browser.

Validate or calculate

9 characters to validate, or the first 8 to calculate the control character. The ES prefix of a VAT number is removed automatically.

ℹ️ This tool checks the format and control character only. To confirm that a company exists or is registered for intra-EU VAT, use the official VIES service or the Agencia Tributaria. For individuals (DNI / NIE), use the Spanish DNI / NIE Validator.

Support TinyToolWeb

Help us keep these tools free and ad-free!

About the Spanish CIF Validator

The CIF (Código de Identificación Fiscal) is the tax identification number of Spanish companies and organisations. Since 2008 it is officially called NIF, but the structure is unchanged: a letter for the type of entity, 7 digits and a control character.

This tool verifies the control character, tells you what kind of entity the first letter refers to and shows the corresponding EU VAT number format (ES + CIF).

Key Features

  • Control validation: accepts both the digit form and the letter form (J, A–I) of the control character.
  • Entity type: S.A., S.L., association, public body, foreign entity and more.
  • Calculator: enter 8 characters to get the missing control character.
  • Smart hints: detects a personal DNI/NIE and points you to the right tool.

How to Use the Tool

  • Step 1: Paste the CIF, with or without the ES prefix.
  • Step 2: Click Validate.
  • Step 3: Read the entity type, province code and sequence number.
  • Step 4: Copy the result with the 📋 button.

Structure of a CIF

PositionMeaning
1Letter for the entity type (A = S.A., B = S.L., G = association…)
2–3Province code where the entity was registered
4–8Sequence number
9Control character: a digit (A, B, E, H), a letter (N, P, Q, R, S, W) or either

Common Use Cases

  • Checking a Spanish supplier or customer before issuing an invoice
  • Validating the registrant document for a .es domain name
  • Adding CIF validation to a checkout form or an ERP
  • Detecting typos in bulk data imports

Tips & Best Practices

  • Some systems require the "usual" control form for each entity type; the tool warns you when a code uses the other form.
  • The province code reflects where the company was first registered, not its current address.
  • A valid format does not guarantee a VAT registration: check VIES before applying the intra-EU reverse charge.

Privacy & Security

The check runs entirely in your browser. The numbers you enter are never sent to a server, stored or logged.