# What is the formula for converting a 10 digit ISBN to a 13 digit ISBN?

I didn't see this question here yet so I thought I would ask if someone has the formula for converting a 10 digit ISBN to a 13 digit ISBN and vice-versa. I know there are several sites that offer conversion such as ISBN.org from Bowker and a few spreadsheets that have macros for it but someone might find the formula useful.

Wikipedia gives it as

1. Remove the ISBN 10 check digit from the end
2. Add 978 to the front
3. Add the ISBN-13 check digit to the end

The check digit is calculated as per Wikipedia

1. Take each digit as an element in in an array x_ i.e. the ith digit i the ISBN is x_i e.g. x4 is the 4th digit.
2. Multiply the even digits by 3 and sum these.
3. add these to the sum of the odd digits
4. find the remainder mod 10
5. subtract from 10 (you have a number 1-10)
6. This is the result as a number between 1 and 10, unless the figure is 10 then the result is 0

`x_13 = (10 - (x_1 + 3x_2 + x_3 + 3x_4 + ... + x_11 + 3x_12) mod10 ) mod 10`

• a couple quick notes isbn13 numbers are also ean numbers (European article number) and there are valid isbn13 numbers that can not be converted to isbn10 numbers because they do not begin with 978. Also note that ean numbers only consist of digits between zero and nine where as the check digit for isbn10 uses 11 values and may contain X and be valid. – hildred Mar 4 '14 at 4:58