Enter a 12 or 13 digit EAN to get an EAN-13 barcode. Leave off the last digit and the check digit is calculated; type all 13 and it is verified.
An EAN-13 has 13 digits. The first two or three are a GS1 prefix that shows which GS1 member organization issued the company's number. That is not the same as the country where the product was made. Then come the company prefix and item number, and the last digit is a check digit.
The check digit uses weights of 1 and 3: multiply the 1st, 3rd, 5th … 11th digits by 1 and the 2nd, 4th … 12th by 3, add them up, and the check digit is what brings the total to the next multiple of 10. For 400638133393 that's 1, giving 4006381333931.
A 13-digit ISBN (starting 978 or 979) is printed as an EAN-13, so you can make a book barcode here from the ISBN. The price add-on some books carry isn't supported. A 12-digit UPC-A is the same as an EAN-13 with a leading 0, so the two are interchangeable at the till.
About the numbers: this tool draws a barcode for a number you already have. It does not issue product numbers. UPC and EAN numbers for products sold in stores come from GS1 (in the US, GS1 US), which licenses a company prefix to each brand. A number you make up yourself will scan, but it isn't registered to you, and retailers and marketplaces that check GS1 data may reject it.