Spain NIF / NIE / CIF Generator
Generate Spanish NIF, NIE, and CIF tax identifiers with Mod-23 & Luhn checks — synthetic mock data only
For Development & Testing Purposes Only - Synthetic Mock Data
Settings
1 valueGenerates one value with a valid checksum. Use Bulk for up to 500 records, or press ⌘/Ctrl+Enter for a fresh one.
Generated value
No value yet
Set options, then press Generate.
Generated values are valid in shape but randomized (Test Data).
About this tool
The Spain NIF / NIE / CIF Generator creates synthetic Spain NIF / NIE / CIF identifiers for software QA, fintech onboarding, e-invoicing, and ERP integration testing. 8 digits + Mod-23 letter (NIF), X/Y/Z + 7 digits + Mod-23 letter (NIE), and corporate entity prefix + 7 digits + check digit (CIF).
Switch to the Validate tab to check existing identifiers against the published structure and check-digit rules, or use Bulk to generate up to 500 test records and export them as JSON, CSV, SQL, TypeScript, Python, or Go arrays. All generation and validation run locally in your browser.
How to use this tool
Choose format or standard
Select the Spain format variant if multiple options are available.
Generate or validate
Generate one test value, validate an existing string, or switch to Bulk for 1–500 records.
Export locally
Copy or download JSON, CSV, or SQL test fixtures. Never use synthetic IDs for real filings.
Spain NIF / NIE / CIF specification
| Attribute | Rule |
|---|---|
| Country | Spain |
| Standard | NIF / NIE / CIF |
| Format & Checksum | 8 digits + Mod-23 letter (NIF), X/Y/Z + 7 digits + Mod-23 letter (NIE), and corporate entity prefix + 7 digits + check digit (CIF). |
Synthetic test data only; does not query government registries or verify real entities.
Frequently asked questions
Are generated Spain NIF / NIE / CIF numbers real?
No. Every generated value is synthetic mock data that satisfies the NIF / NIE / CIF format and checksum rules for QA and development testing only.
How does Spain NIF / NIE / CIF Generator validate numbers?
8 digits + Mod-23 letter (NIF), X/Y/Z + 7 digits + Mod-23 letter (NIE), and corporate entity prefix + 7 digits + check digit (CIF). All checks run 100% client-side in your browser.
Can I export bulk test data?
Yes. Switch to the Bulk tab to generate 1–500 values and export JSON, CSV, SQL INSERT, TypeScript, Python, or Go arrays.
Related tools
VAT Number Generator
Generate VAT numbers for EU, UK, Switzerland, Norway and global tax integration testing.
SEPA IBAN Generator
Generate SEPA-eligible IBAN and BIC pairs with ISO 7064 Mod 97-10 checks.
TIN Generator
Generate taxpayer identification number test data for the US, UK, Canada, Australia, Europe, Turkey and India.
Tax Number Generator
Generate valid tax identification numbers for testing (TR, US, SG, etc.)
Tax ID Validator
Auto-detect and validate VAT, EIN, TIN and GST identifiers with batch checksum reporting.