ISBN

An ISBN has 13 digits and starts with 978 or 979. Its last digit is a check digit, worked out the same way as a barcode’s.

What an ISBN is

Since 1 January 2007 every ISBN has 13 digits. An ISBN-13 is also an EAN-13 barcode number, which is why it starts with 978 or 979. A number that starts with 979-0 is not an ISBN at all but an ISMN, a number for printed music, and the program says so rather than call it a broken ISBN.

The program makes no ISBN-10. The ISBN Users’ Manual does not give its check digit rule, and no ten-digit ISBN has been issued since 2007.

The check digit

Multiply the first twelve digits by 1 and 3 in turn, starting with 1 on the left. Add up the products, take the remainder after dividing by 10, and subtract it from 10. The result is the check digit, and a result of 10 is written 0.

The manual works its own ISBN through, 978-92-95055-12-4. The products are 9, 21, 8, 27, 2, 27, 5, 0, 5, 15, 1 and 6, they add up to 126, the remainder is 6, and 10 - 6 is 4.

Valid ISBNs for your tests

terminal
$ qadg quick isbn --count 5 --seed example
9786830568958
9786977927472
9786969333489
9786872739040
9786948914043

Every ISBN starts with 978-67, 978-68 or 978-69, a block the ISBN agency had given to no registration group when it was last checked, on 7 September 2026. No book carries such a number today. The agency can start giving the block out later, so it is not promised to stay empty.

What your application should do with a broken one

Refuse an ISBN whose last digit does not match. A changed digit always shows. Swapping two neighbouring digits that differ by 5, such as 2 and 7, does not change the check digit, so the program does not count such a swap as damage and says so in the manifest.

Broken ones for your tests

The recipe below makes 100 values and asks for damage in 20% of the rows. Download it and run it as it is, then change the count or the share to fit your tests.

The recipe

isbn.yaml
# ISBNs for testing, with one broken value asked for in about a fifth of the
# rows.
#
# Every ISBN starts with 978-67, 978-68 or 978-69, a block no registration group
# held when it was last checked. The damage changes a digit or swaps two, and
# the manifest says your application should reject each one. It also lists the
# damage this build could not carry out, with the reason.
#
#   qadg generate isbn.yaml
#
# writes book.csv, expectation-manifest.json and run-note.json. The same seed
# breaks the same values on every machine.
version: "0.1"
seed: "isbn"
locale: en-US
entities:
  book:
    count: 100
    fields:
      isbn: { generator: isbn }
policy:
  layers: [L3]
  rows: 20%
  per_row: exactly_one
output:
  format: csv

Run it

Save the recipe, then run this in the same folder. This is what the program printed for it.

terminal
$ qadg generate isbn.yaml
       book: 100 rows, 1 column
1 table, 100 rows written
29 defects ordered, 8 applied, manifest in expectation-manifest.json
21 defects could not be applied, and the manifest carries the reason for each one
  4 because this run lacks something they need, and the manifest says what for each one
  17 because this build has no implementation of them yet

What it damaged

The recipe ordered 29 defects, and this build applied the 8 below. The other 21 are in the manifest as not applied, each with its reason, and the run above counts them by reason.

L3.checksum.off_by_onereject

book 11, column isbn

9786759158094 → 9786759158095

L3.checksum.transposed_digitsreject

book 13, column isbn

9786937491296 → 9786973491296

L3.checksum.off_by_onereject

book 40, column isbn

9786929158503 → 9786929158504

L3.checksum.transposed_digitsreject

book 44, column isbn

9786995278013 → 9786959278013

L3.checksum.off_by_onereject

book 57, column isbn

9786872012983 → 9786872012984

L3.checksum.transposed_digitsreject

book 62, column isbn

9786918210007 → 9786918201007

L3.checksum.off_by_onereject

book 88, column isbn

9786944492729 → 9786944492720

L3.checksum.transposed_digitsreject

book 89, column isbn

9786931559350 → 9786931595350

Sources

  • International ISBN Agency, ISBN Users’ Manual, seventh edition, 2017, appendix A1.1.
  • International ISBN Agency, ISBN ranges file, read on 7 September 2026.
  • International ISMN Agency, for numbers starting with 979-0.