/svensk-organisasjonsnummer

Swedish Organization Number Generator & Validator

Validate and generate valid Swedish organization numbers (10 digits, Luhn) locally for testing.

Generate a valid test organization number (Luhn).
-

How it works

A Swedish organization number (organisationsnummer) is 10 digits with a trailing Luhn (MOD10) check digit, the same check as a personal number. The third digit is always 2 or higher, which distinguishes org numbers from personal numbers. The numbers here are valid test data only.

About this tool

The tool validates and generates Swedish organization numbers. The number is 10 digits, with the last being a Luhn (MOD10) check digit, the same as Swedish personal numbers and credit cards. The third digit is always 2 or higher; that’s what distinguishes org numbers from personal numbers (which have month 01–12 there). Useful for developers building invoicing, customer registration or integrations with Swedish businesses. Generated numbers are mathematically valid only. All in-browser.

How to use it

  1. Paste or type a 10-digit Swedish organization number.
  2. See at once if it is valid (Luhn check).
  3. Click "Generate" for a valid test number.
  4. Copy the result for testing or development.

Examples

Known company: Volvo AB
Input556036-0793
OutputValid (Luhn passes)
Wrong check digit
Input556036-0794
OutputInvalid
The Luhn algorithm doubles every second digit from the right (starting with the second-to-last), subtracts 9 if the product > 9, and sums all digits. Total mod 10 must be 0. Changing one digit always gives an invalid sum, which is why Luhn is used so widely (credit cards, IMEI, personal numbers, org numbers).

Common use cases

  • Validating customer input in Swedish invoicing systems.
  • Generating test data for QA and development.
  • Checking org numbers imported from CSV or Excel.
  • Building Luhn validation into forms.
  • Verifying OCR-read numbers are structurally correct.

Frequently asked questions

What do the first digits mean?
The first digit classifies the legal entity type: 1 = estates of deceased, 2 = state/municipality/region, 3 = foreign entities, 5 = limited company (AB), 6 = certain limited partnerships, 7 = economic associations, 8 = non-profit associations and foundations, 9 = general partnerships (KB) and some partnerships. AB is the most common category and thus starts with 5. The second digit refines the coding. The third digit must be 2–9 for the number to be an org number rather than a personal number.
Difference between org number and VAT number?
The organization number identifies the company in all contexts (tax, Bolagsverket, Skatteverket, banks, authorities). The Swedish VAT number is the country code SE + org number without hyphen + "01" at the end (12 digits total), e.g. SE556036079301. VAT number is only used for EU trade and invoicing. Not every company is VAT-registered (e.g. exempt-only businesses), so an org number doesn’t automatically mean there’s a VAT number.
Can I use generated numbers for anything real?
No. The numbers are only mathematically valid (they pass Luhn) but are not assigned to any real Swedish company. Using them in real settings (invoicing, contracts, VAT reporting) will be rejected by Skatteverket or Bolagsverket, and it can be an offence to pose as a company that doesn’t exist. Use only for development, testing, docs, training and unit tests. For real checks use Bolagsverket or Skatteverket’s VAT lookup.
Is the hyphen format required?
No, but it’s the standard notation. The format is "NNNNNN-NNNN" with a hyphen after the first six digits. Skatteverket and Bolagsverket accept both forms, but public registers and invoices usually use the hyphen. Our tool accepts both, since it strips all non-digits before the Luhn check. Note that leading zeros must not be dropped; org numbers must always be 10 digits, never 9.

Technical background

Luhn (MOD10) algorithm: strip non-digits, walk digits from right. Double every second digit starting from the second-to-last. If doubling gives > 9, subtract 9 (equivalent to summing the two digits, e.g. 14 → 1+4=5). Sum all digits. Valid if total mod 10 = 0. Generation: pick random d1..d9 with d3 ≥ 2, compute d10 so total mod 10 = 0. Luhn catches all single-digit errors and most two-digit permutations (except 09 ↔ 90). Source: Skatteverket and Bolagsverket spec. All local in browser JavaScript; no external calls.