PHPackages                             fale/isbn - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fale/isbn

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fale/isbn
=========

ISBN library

3.1.0(6y ago)88524.8k—0.2%17[3 issues](https://github.com/Fale/isbn/issues)4AGPL-3.0PHPPHP &gt;=5.3.0CI failing

Since Jan 19Pushed 6y ago10 watchersCompare

[ Source](https://github.com/Fale/isbn)[ Packagist](https://packagist.org/packages/fale/isbn)[ Docs](http://github.com/fale/isbn)[ RSS](/packages/fale-isbn/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (15)Used By (4)

ISBN PHP library [![Build Status](https://camo.githubusercontent.com/9bab9afdf6731d0c057a81fbde4e8745dd1e20c2a3a9aff3e1af6e3ee685539a/68747470733a2f2f7472617669732d63692e6f72672f46616c652f6973626e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Fale/isbn)
===========================================================================================================================================================================================================================================================================

[](#isbn-php-library-)

This library is developed to provide all tools needed to handle ISBN (both ISBN-10 and ISBN-13) codes to PHP developers.

IMPORTANT NOTICE
----------------

[](#important-notice)

`dev-master` could be pretty different from the **3.x** version. If you want to stay with version **3.x**, please use `3.0.0` or `3.0.x-dev` or `3.x-dev`.

IMPORTANT NOTICE NUMBER 2
-------------------------

[](#important-notice-number-2)

ISBN ranges change every so often. Data are right as of Wed, 15 Nov 2017 13:30:29 CET.

Initialization
--------------

[](#initialization)

```
$isbn = new Isbn\Isbn();
```

Check
-----

[](#check)

This function allows you to verify if an ISBN code is an ISBN-10 or ISBN-13. This does not verifies if the ISBN code is valid. To check if the ISBN code is valid, you can use the `Validation` class. Examples:

```
$isbn->check->is10('888183718'); // Will return false
$isbn->check->is13('9788889527191'); // Will return true
$isbn->check->is13('978888952719'); // Will return false
$isbn->check->identify('8881837188'); // Will return 10
$isbn->check->identify('888183718'); // Will return false
$isbn->check->identify('9788889527191'); // Will return 13
$isbn->check->identify('978888952719'); // Will return false
```

Validation
----------

[](#validation)

This class allows you to validate ISBN-10 and ISBN-13. Examples:

```
$isbn->validation->isbn('8881837188'); // Will return true
$isbn->validation->isbn('8881837187'); // Will return false
$isbn->validation->isbn('9788889527191'); // Will return true
$isbn->validation->isbn('9788889527190'); // Will return false
$isbn->validation->isbn10('8881837188'); // Will return true
$isbn->validation->isbn10('8881837187'); // Will return false
$isbn->validation->isbn13('9788889527191'); // Will return true
$isbn->validation->isbn13('9788889527190'); // Will return false
```

Hyphens
-------

[](#hyphens)

This class provides simple functions to work with hyphens.

### Add Hyphens

[](#add-hyphens)

This function allows you to put correct hyphens in ISBN-10 and ISBN-13. Examples:

```
echo $isbn->hyphens->addHyphens('9791090636071'); // Will return 979-10-90636-07-1

echo $hyphens->addHyphens('9791090636071', ' '); // Will return 979 10 90636 07 1
```

### Remove Hyphens

[](#remove-hyphens)

This function allows you to remove hyphens from the ISBN-10 and ISBN-13. Examples:

```
$isbn->hyphens->removeHyphens('85 359 0277 5'); // Will return 8535902775
$isbn->hyphens->removeHyphens('0-943396-04-2'); // Will return 0943396042
$isbn->hyphens->removeHyphens('978 988 00 3827 3'); // Will return 9789880038273
$isbn->hyphens->removeHyphens('979-10-90636-07-1'); // Will return 9791090636071
```

### Fix Hyphens

[](#fix-hyphens)

This function allows you to fix hyphens in ISBN-10 and ISBN-13

```
$isbn->hyphens->fixHyphens('85 35902 77 5', ' '); // Will return 85 359 0277 5
$isbn->hyphens->fixHyphens('0 943 3960 42'); // Will return 0-943396-04-2
$isbn->hyphens->fixHyphens('978 988 003827 3', ' '); // Will return 978 988 00 3827 3
$isbn->hyphens->fixHyphens('979-10906-36-07-1'); // Will return 979-10-90636-07-1
```

CheckDigit
----------

[](#checkdigit)

This class allows you to calculate the check digit for ISBN-10 and ISBN-13. Examples:

```
$isbn->checkDigit->make('888183718'); // Will return 8
$isbn->checkDigit->make('978888952719'); // Will return 1
$isbn->checkDigit->make10('888183718'); // Will return 8
$isbn->checkDigit->make13('978888952719'); // Will return 1
```

Translate
---------

[](#translate)

This class allows you to convert ISBN-10 to ISBN-13 and back. Examples:

```
$isbn->translate->to13('8889527191'); // Will return 9788889527191
$isbn->translate->to10('9786028328227'); // Will return 6028328227
```

Develop this library
====================

[](#develop-this-library)

If you are interested in some new features please open a bug on GitHub. If you already have a patch available, please, open a pull request. Before opening a pull request, be sure that all tests are passed.

Generation
----------

[](#generation)

- Get the `RangeMessage.xml` file from [https://www.isbn-international.org/range\_file\_generation](https://www.isbn-international.org/range_file_generation)
- `cp import/RegistrantElement.php /tmp`
- `cp RangeMessage.xml /tmp`
- `podman run --rm -it --volume /tmp:/tmp php sh -c "cd /tmp && php RegistrantElement.php" > /tmp/out`

Tests
-----

[](#tests)

To check the tests run the following:

```
vendor/bin/phpunit tests
```

from the project root folder. If the folder `vendor` is empty or non-existing, run `composer install` or `composer.phar install` depending on your `composer` installation.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 78.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~159 days

Recently: every ~166 days

Total

14

Last Release

2436d ago

Major Versions

1.0.0 → 2.0.02014-03-02

1.x-dev → 3.0.02015-10-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/b5e41f21aba3ce8545625ece706127365673a5570eb3c75e4b234278775fce1b?d=identicon)[Fale](/maintainers/Fale)

---

Top Contributors

[![Fale](https://avatars.githubusercontent.com/u/77888?v=4)](https://github.com/Fale "Fale (60 commits)")[![adhocore](https://avatars.githubusercontent.com/u/2908547?v=4)](https://github.com/adhocore "adhocore (6 commits)")[![mejta](https://avatars.githubusercontent.com/u/498441?v=4)](https://github.com/mejta "mejta (4 commits)")[![lasselehtinen](https://avatars.githubusercontent.com/u/1290186?v=4)](https://github.com/lasselehtinen "lasselehtinen (2 commits)")[![linkkingjay](https://avatars.githubusercontent.com/u/2505538?v=4)](https://github.com/linkkingjay "linkkingjay (2 commits)")[![AlexObreja](https://avatars.githubusercontent.com/u/5020627?v=4)](https://github.com/AlexObreja "AlexObreja (1 commits)")[![ronanguilloux](https://avatars.githubusercontent.com/u/313677?v=4)](https://github.com/ronanguilloux "ronanguilloux (1 commits)")

---

Tags

ISBNISBN-10ISBN-13

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fale-isbn/health.svg)

```
[![Health](https://phpackages.com/badges/fale-isbn/health.svg)](https://phpackages.com/packages/fale-isbn)
```

###  Alternatives

[nicebooks/isbn

ISBN tools

29336.9k3](/packages/nicebooks-isbn)[barcode-bakery/barcode-1d

Generates 1D barcodes from a PHP server to a file or HTML document.

10146.1k1](/packages/barcode-bakery-barcode-1d)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
