DevTools Logo

Spain NIF / NIE / CIF Generator

Spain NIF / NIE / CIF Generator

Generate Spanish NIF, NIE, and CIF tax identifiers with Mod-23 & Luhn checks — synthetic mock data only

Runs in your browser

For Development & Testing Purposes Only - Synthetic Mock Data

Settings

1 value

Generates 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).

Legal Disclaimer: Generated data is for software testing and validation purposes only (e.g. verifying input masks, form validation, or database seeding). It is randomly generated and not taken from any real record, but a random value can coincidentally match a real, issued number, so never use it in real applications, payments, KYC or official forms. Using it to impersonate real people or for any fraudulent activity is illegal.

    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

    1. Choose format or standard

      Select the Spain format variant if multiple options are available.

    2. Generate or validate

      Generate one test value, validate an existing string, or switch to Bulk for 1–500 records.

    3. Export locally

      Copy or download JSON, CSV, or SQL test fixtures. Never use synthetic IDs for real filings.

    Spain NIF / NIE / CIF specification

    AttributeRule
    CountrySpain
    StandardNIF / NIE / CIF
    Format & Checksum8 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.