Validate an ISBN-10 or ISBN-13 by its check digit, and convert between the two formats. Handles hyphens and spaces.
An ISBN ends in a check digit computed from the others, so a single typo almost always fails the check. ISBN-13 (used since 2007) is an ISBN-10 with a 978 prefix and a recalculated check digit.
The last character of an ISBN is calculated from the preceding digits with a fixed formula. If any digit is mistyped, the check digit no longer matches, so the validator reports it as invalid. ISBN-10 can end in X, which represents the value 10.
An ISBN-13 that starts with 978 maps to an ISBN-10 by dropping the prefix and recalculating the check digit, and back again. ISBN-13 numbers starting with 979 have no ISBN-10 equivalent.
No. Hyphens and spaces are ignored, so you can paste an ISBN in any common formatting and it will still validate.