How to Generate a Test ABN for Software Testing
Anyone wiring up an invoicing tool, a supplier onboarding form, or anything that touches Australian business data hits the same wall: the ABN field needs testing, and typing a real company's Australian Business Number into your staging database is both sloppy and a privacy problem. The fix is a test ABN — a number that passes the official check but isn't registered to any business.
The ABN checksum, briefly
An ABN is 11 digits, and like the TFN it carries a built-in checksum — a different one. The algorithm, defined by the Australian Business Register:
- Subtract 1 from the first (leftmost) digit.
- Multiply each of the 11 digits by its weight. The weights, left to right, are
10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19. - Sum the products.
- A valid ABN is one where that sum is divisible by 89.
That "subtract 1 from the first digit" step is the part people forget, and it's why a number that looks right can still fail. It also means a valid ABN never starts with a digit that would make the first position negative in a way the check rejects — the structure is deliberately narrow.
Why random numbers won't do
Only about one in 89 random 11-digit numbers satisfies the divisibility-by-89 rule. So if your test fixture just generates "some 11-digit number," your own validation will reject it roughly 99% of the time — and if your validation doesn't reject it, that's a bug you've just hidden instead of found.
To generate a passing ABN, you fix most of the digits and solve the remaining ones so the weighted sum lands on a multiple of 89, applying the first-digit adjustment. The output is a well-formed ABN that no business owns.
Test ABN vs. a real lookup
A generated ABN is for format and flow testing — does the field accept it, does the checksum validator pass it, does the record save. It is not a substitute for a real registration check. If your application needs to confirm an ABN actually belongs to a trading entity, that's a lookup against the ABR's public register, which is a live data question, not a checksum. Keep the two concerns separate: generate dummy ABNs for your test suite, and call the register only in paths that genuinely need real-world verification.
Legitimate use only
Generating a test ABN for software development, QA, demos, or seeding a dev database is standard practice. Presenting a fabricated ABN as a real business registration — on a tax invoice, a government form, or to a counterparty — is a different thing entirely and is unlawful. Test data stays in your test environment.
Try it
The Australian ABN Generator & Validator generates valid-format test ABNs and validates any ABN against the official weighted checksum, all in your browser with nothing sent to a server. For the related identifiers, there's an ACN generator for company numbers and a TFN generator for tax file numbers.
Hanuman Singh · built snaptxt.app · hanumansingh.dev