esc
ID checkers

OCR number generator:
Sweden, Bankgiro

Type an invoice or customer number to get its OCR number, with and without a length digit. Separate several with commas to make a list.

More tools for Sweden Other countries

How to use OCR number generator

  1. 01Type the numberInvoice or customer number.
  2. 02Choose the versionWith or without length digit.
  3. 03Copy the OCR numberOr a list, one per line.
Front and back of an ID card on one sheet of paper

1234568 → 12345682.

An OCR number is the reference on Swedish Bankgiro invoices: your invoice or customer number, an optional length digit and a check digit worked out with the 10-modul (Luhn) method. The rules come from Bankgirot’s user manual for Bankgiro Inbetalningar.

Räkna ut OCR-nummer for your Bankgiro invoices: type the invoice or customer number and the tool adds the 10-modul check digit, and shows the version with a length digit next to it. Separate several numbers with commas and Copy gives you one OCR number per line.

The parts of an OCR number

Bankgirot’s user manual for Bankgiro Inbetalningar sets the rules: an OCR number is numeric, has 2 to 25 digits, and always ends in a check digit calculated with the 10-modul method. Between the reference and the check digit there may be a length digit.

  • Reference: your invoice or customer number, at most 23 digits.
  • Length digit (optional): the last digit of the whole number’s length.
  • Check digit (always): calculated over the reference and the length digit.

Calculating the check digit

  1. Leave out the check digit and start from the right.
  2. Multiply the digits by 2, 1, 2, 1 and so on.
  3. For products of 10 or more, subtract 9 (or add their two digits).
  4. Add everything up. The check digit is the difference to the next ten. In Bankgirot’s example 1234568 the sum is 28, so the check digit is 2: 12345682.

Hard control, variable length and fixed length

Your Bankgiro agreement decides how strictly incoming OCR numbers are checked. With hard control, payments are only accepted when the check digit is right. With hard control and variable length, the length digit must also match the number’s length. With fixed length, the number must have the length agreed with the bank.

If you don’t know which one you have, ask your bank before you start sending invoices. Bankgirot recommends variable length over fixed length because you can use several lengths at once.

At a glance

Price
Free. No sign-up, no watermark.
Privacy
Your text stays in your browser. Nothing is uploaded.
Works in
Chrome, Edge, Firefox and Safari, on phones and computers

Questions

Do I need the length digit?

Only if your Bankgiro agreement has hard OCR control with variable length. With plain hard control, the check digit is enough. Ask your bank which control your agreement has.

How is the length digit worked out?

It is the last digit of the whole OCR number’s length, counting the length digit and the check digit. A 10-digit or 20-digit OCR number gets 0, a 9-digit one gets 9.

How long can an OCR number be?

From 2 to 25 digits, including the check digit and any length digit.

Can I check an OCR number I already have?

Yes. Paste it in. The tool says whether the last digit is a correct check digit and whether the digit before it fits as a length digit.

Is my number sent anywhere?

No. Everything runs in your browser.

What does the length digit look like for a 10-digit OCR number?

It is 0, because only the last digit of the length is used. A 20-digit number also gets 0, and a 13-digit one gets 3.

Is the method the same as for personnummer?

Yes. Bankgirot notes that the same 10-modul check digit is used in personnummer, organisationsnummer, bank account numbers and Bankgiro numbers.