A PHP library to convert and validate ISBNs & EANs

2.1.5 2020-11-17 00:00 UTC

This package is auto-updated.

Last update: 2021-01-17 08:40:07 UTC



This package can be used to:

  • validate an ISBN code
  • convert codes between ISBN-10, ISBN-13 and EAN (without hyphens) formats
  • calculate the checksum digit
  • show the registration agency (country or language)



Install with composer:

composer require biblys/isbn:^2.1.5


Use case: converting an EAN (9782843449499) to an ISBN-13 (978-2-84344-949-9).


use Biblys\Isbn\Isbn as Isbn;
// require_once __DIR__.'/vendor/autoload.php';

$ean = '9782843449499';
$isbn = new Isbn($ean);

try {
    $isbn13 = $isbn->format("ISBN-13");
    echo "ISBN-13: $isbn13";
} catch(Exception $e) {
    echo "An error occured while parsing $ean: ".$e->getMessage();


Run tests with PHPUnit:

composer install
composer test

Run tests in a docker container:

composer docker:test

Run tests in a docker container using a specific PHP version:

PHP_VERSION=7.1 composer docker:test

ISBN ranges update

New ISBN ranges may be added from time to time by the International ISBN Agency. Whenever it happens, this library must be updated. If a range update is necessary, please open an issue on Github. You can also open a pull request after updating the ranges your self with the following commands:

composer install
composer run update-ranges

Or using a docker container:

composer docker:update-ranges


See Github releases