What are barcodes and how are they used?
All manufacturers and merchants assign tracking numbers to their products. The generic term for this is SKU (Stock Keeping Unit). Each firm has its own SKU codes and conventions, private to the firm or perhaps shared among a few partners. For the book trade, the ISBN is their SKU and, unlike almost every other industry, that SKU is used throughout the trade, from the manufacture of the physical edition all the way through to the retailers.
The ISBN is a set of numbers that uniquely identify an individual book product (title, format, size, edition, etc.). The old ISBN was 10 digits long, but that was replaced by a 13-digit standard in 2007. Technically, the 10-digit version is called “ISBN” and the 13-digit version is called “EAN”, but colloquially they're both referred to as “ISBN”. The name for the new standard is “EAN-13”.
Barcodes are for machines to read, using scanners. They were introduced in the 1970s and are now ubiquitous. When you look at the bars, each cluster of lines (bars) above a number represents that digit to a scanner, The contrast and exact widths matter.
Different international standards for different uses have different barcode layouts. (Look at your groceries or other purchases for examples.) In the book trade, only the layout for EAN-13 is relevant.
The big cluster on the left is for the SKU (the ISBN, for the EAN-13 standard), and the small cluster on the right is for PRICE, mostly. The value “90000” for the price means “no price”, that is, the retailer's own system will be used to lookup the price when the barcode is scanned in at the register. This allows a retailer to set whatever price they want, sometimes by slapping their own barcode sticker over the book's barcode, or sometimes by just reading the price printed elsewhere on the cover, or a discount applied to it. Most indies use “90000” as the price, for the convenience of the retailers.
Every human-readable bit of text in a barcode is just for humans — the scanners pay no attention to those letters/numbers.
How do you get a barcode?
Many companies want to sell you a barcode, and some try to get as much as $25 for the service. Don't fall for this, as an indie author — it is never necessary to pay for a barcode.
To begin with, both Amazon KDP and Ingram will supply a barcode for your book for free. When you use their templates to design your cover, you will see a space marked out for the barcode, and you can shift that to wherever you want it to appear (along the bottom of the back cover).
But what if you want to print your book via some other POD supplier, or do a short-run print locally? You will need to give them a barcode to use. There is nothing proprietary about the barcode that Amazon or Ingram have added to the back of your book, but just copying that won't deliver a very clean image. Instead, you want to use a fresh image generated by a barcode service, and there are many free ones out there.
I use a UK company for this: https://www.free-barcode-generator.net/ean-13/.
One of the things I like about it is that they look up my ISBN and accurately decompose it (I have a range of 1000).
I also like that the height and layout is identical to that used by Amazon. The only thing Amazon does differently is to add the text “ISBN 9781629620633” above the left block, and we can do that, too, if we want to. Remember, that's only for humans to read, not machines.
I can output the barcode into any number of formats and give it to any other printer to use, or stick it on the back of my cover image myself.
There's no reason to ever buy these from someone else, not for our simple needs.