I did a lot of research into this awhile back because all my coffees had to be barcoded for retail sales.
So you can buy out of date barcodes that will work for you (long story but you can find out all about it on the Internet). These are unique barcode numbers that you own. No one else does. People sell them for about $20 each.
But starting a business and spending a ton of money the last thing you want to do is pony up more $ for a barcode. Here in Europe I can't use the U.S. barcodes that folks are selling for $20. No, I've got to go through some government agency and join the club for about 1,000 euro and then pay about 200 euro per barcode. Who can afford that unless you're Kraft Food or someone like that. I sure couldn't so I did what all us entrepreneurs do, I got creative and generated my barcodes for free.
First find out how many digits you'll need. Here in Europe they use a 13 digit barcode but in the US I think it is shorter. Just go to the coffee aisle in your local store and see how many digits Folgers, etc., have on their packages.
Then I downloaded Bartender Barcode software. They have a one month free trial. It is great software if you're a company that needs to generate endless bar codes--like Kraft Foods--but for your coffees you won't need too many.
By the way, this software makes proper barcodes. There is some software on the web where you can generate barcodes but the ones I generated were very hard to scan and created problems with some retailers. Quite a pain in the butt for me. So I dug deeper and that's when I found Bartender.
So I used the software to generate 13 digit barcodes (Bartender has lots of options so you'll be able to get what you need for the U.S.). It is true that someone else could be the owner of one of the random numbers I generated but chances are that since 13 digits represents TRILLIONS no one else has generated that number. And if they have, chances are it is on a product that isn't in the store I'm in. Maybe it is a barcode for green and pink striped Converse high-tops and since that probably isn't in your retailer's system no big deal. On the off chance you do duplicate a number someone owns and is in the store your coffee is in, then just change your number.
Anyway (sorry for being long winded here), I generated about 100 barcodes (and by the way, the Bartender software will often, as you type in the number you've come up with, finish the number for you because based on the beginning numbers you use an algebraic equation kicks in and finishes the sequence which is one reason I recommend Bartender because some of the web generation software doesn't follow the algebraic rules and you get a bogus number that won't scan) and just saved them in a file on my computer. So I used some and have a whole bunch, that I know will work, for future use.
By the way, when you take note of some U.S. barcodes you may find that the first few numbers are the same and then the last 5 or 6 numbers are what change. So I followed suit with that. I chose 7 beginning numbers that never changed and then just changed the last six to get my barcodes.
Remember, the barcode is just a number that identifies your product so don't overthink your numbers, just get busy and create them.
Oh, and when you put them on your label don't make them too small. There are some sizing rules of thumb you can find on the Internet. Mine are about 1-1/2" wide x 1-1/4" tall. They'd probably scan at a smaller size but since I've got the space on my label I've left them at that. When in doubt go to the retailer that wants to work with you and see if the size you need to use will scan and then adjust, or not, from there.
Hope this helps.