BPAY CRN Check Digit Calculator

Validate a BPAY customer reference number against any of the four common BPAY check-digit algorithms. Useful for accountants, biller administrators, and anyone debugging a payment that won't go through. All maths runs in your browser.

2 to 20 digits. Spaces and hyphens are stripped automatically.

How the algorithms work

Each algorithm walks the CRN body — every digit except the rightmost — from right to left, applies a per-position weight, sums the results, and folds the total into a single check digit. The validator simply re-runs that calculation and compares the resulting digit to whatever you actually typed at the end of the CRN.

Mod 10 v01 (Luhn) in JavaScript

function mod10v01(crn) {
  const ds = crn.split("").map(Number);
  const check = ds.pop();
  let sum = 0;
  for (let i = ds.length - 1, p = 1; i >= 0; i--, p++) {
    let d = ds[i];
    if (p % 2 === 1) { d *= 2; if (d > 9) d -= 9; }
    sum += d;
  }
  const expected = (10 - (sum % 10)) % 10;
  return expected === check;
}

Mod 10 v05 (weights 3, 7, 1)

function mod10v05(crn) {
  const ds = crn.split("").map(Number);
  const check = ds.pop();
  const weights = [3, 7, 1];
  let sum = 0;
  for (let i = ds.length - 1, p = 0; i >= 0; i--, p++) {
    sum += ds[i] * weights[p % 3];
  }
  const expected = (10 - (sum % 10)) % 10;
  return expected === check;
}

Mod 11 and Mod 11 v10 (weights 2..7)

function mod11(crn) {
  const ds = crn.split("").map(Number);
  const check = ds.pop();
  let sum = 0;
  for (let i = ds.length - 1, p = 0; i >= 0; i--, p++) {
    sum += ds[i] * ((p % 6) + 2);
  }
  const candidate = (11 - (sum % 11)) % 11;
  if (candidate === 10) return false; // no single-digit check digit exists
  return candidate === check;
}

function mod11v10(crn) {
  const ds = crn.split("").map(Number);
  const check = ds.pop();
  let sum = 0;
  for (let i = ds.length - 1, p = 0; i >= 0; i--, p++) {
    sum += ds[i] * ((p % 6) + 2);
  }
  return (sum % 10) === check;
}

Frequently asked questions

What does this calculator do?

Paste a BPAY customer reference number (CRN) and pick a check-digit algorithm. The calculator runs the algorithm on every digit except the rightmost one, computes what the trailing check digit should be, and reports whether your CRN's actual trailing digit matches. It also shows the expected digit so you can correct a typo at a glance.

What's the difference between Mod 10 v01 and Mod 10 v05?

Both produce a single check digit and target the same goal — catching mis-keys. Mod 10 v01 is the Luhn algorithm: from the right, every second body digit is doubled (and reduced if it exceeds 9) before summing. Mod 10 v05 instead multiplies digits by the cycling weights 3, 7, 1 from the right. They produce different check digits for the same body, so picking the wrong one prints unscannable QRs. If you don't know which your biller uses, ask your bank.

Why does Mod 11 sometimes produce 'X'?

Mod 11 sets the check digit to (11 minus the sum modulo 11). When the sum modulo 11 equals 1, that formula yields 10 — which is two characters, not one. Some implementations encode that as 'X', but BPAY billers using Mod 11 typically reject CRN bodies that produce a 10. Mod 11 v10 sidesteps the issue by taking sum modulo 10 instead of (11 minus sum modulo 11).

Why does my CRN have no check digit at all?

Some BPAY billers use fixed CRNs (one number for all customers) or sequential numbering with no check digit. In those cases, leave the algorithm set to "None". The CRN is still validated against the basic 2 to 20 digit length rule, but no algorithmic check is performed.

Is this calculator the same as the one inside the BPAY QR generator?

Yes — it imports the same validators.ts module that the /bpay generator uses. Single source of truth means a CRN that validates here will also validate inside the QR generator, and vice versa.

qrsansar.com is not affiliated with BPAY Pty Ltd or Australian Payments Plus. BPAY® is a registered trademark of BPAY Pty Ltd, part of Australian Payments Plus.

¡Mantente actualizado!

Recibe notificaciones sobre nuevas funciones y actualizaciones de QRSansar.