Skip to content
UPC Maker

How to Create Barcodes in Excel or Google Sheets

By UPC Maker · Last reviewed November 13, 2026

You can make barcodes in Excel or Google Sheets by formatting a column with a barcode font. It works well for one barcode type, Code 39, and badly for most others unless you add extra steps. Before any of that, the spreadsheet itself has to stop damaging your numbers, because that is where most product lists go wrong.

First, protect the numbers

A spreadsheet treats a UPC as a quantity, not as a code. Three things happen as a result.

  • Leading zeros vanish. Type 036000291452 and the cell keeps 36000291452, which is 11 digits and no longer a UPC.
  • Long numbers turn into shorthand. In Excel, a 12-digit number in a narrow general-format cell can show as 8.12346E+11.
  • Very long numbers lose digits. Excel keeps 15 digits of precision. An 18-digit pallet number has its last three digits replaced with zeros, for good.

The fix is the same in both programs: make the column text before the numbers go in.

  1. Select the empty column.
  2. In Excel, set the cell format to Text. In Google Sheets, choose Format, then Number, then Plain text.
  3. Paste or type the numbers.

If the zeros are already gone, rebuild them with a formula. For a 12-digit UPC in cell A2, use =TEXT(A2,"000000000000"). Use thirteen zeros for an EAN-13. One more trap: a CSV file opened by double-click in Excel is converted again, so the zeros disappear a second time. Import the file and set the column to Text instead.

Add UPC check digits with a formula

If your list holds the first 11 digits of each UPC, a formula can add the twelfth. With the 11 digits stored as text in A2, put this in B2. It works in Excel and in Google Sheets.

=MOD(10-MOD(3*(MID(A2,1,1)+MID(A2,3,1)+MID(A2,5,1)+MID(A2,7,1)+MID(A2,9,1)+MID(A2,11,1))+MID(A2,2,1)+MID(A2,4,1)+MID(A2,6,1)+MID(A2,8,1)+MID(A2,10,1),10),10)

Then join the two in C2 with =A2&B2.

Check the formula against a known number

Test it with 03600029145 before trusting it on a whole column.

  1. Digits in positions 1, 3, 5, 7, 9 and 11: 0 + 6 + 0 + 2 + 1 + 5 = 14.
  2. Multiplied by 3: 42.
  3. Digits in positions 2, 4, 6, 8 and 10: 3 + 0 + 0 + 9 + 4 = 16.
  4. Total: 42 + 16 = 58.
  5. The remainder after dividing by 10 is 8, and 10 minus 8 is 2.

B2 should show 2, and C2 should show 036000291452. The outer MOD in the formula handles the case where the total already ends in 0, which would otherwise give 10 in place of 0. To confirm single numbers, paste them into the check digit calculator.

The formula only does arithmetic. It cannot tell you whether a number is licensed to your brand, and it should not be used to invent UPCs. Numbers that retailers accept come from GS1.

The barcode font method

A barcode font replaces each character with a pattern of bars. It is the method most tutorials show, and it is reliable for Code 39.

  1. Get a Code 39 font. In Google Sheets, open the font menu, choose More fonts and search for Libre Barcode 39. In Excel, the font has to be installed on the computer first.
  2. Put your code in A2, for example TS-BLK-M.
  3. In B2, wrap it in asterisks: ="*"&A2&"*". The asterisks are the start and stop marks a scanner looks for.
  4. Set B2 to the barcode font and raise the size until the bars are easy to scan.
  5. Print one and scan it before you print the rest.

Code 39 holds capital letters, digits and a few symbols. Lowercase letters will not encode, so use ="*"&UPPER(A2)&"*" if your list has any. More on what it can carry is on the Code 39 generator page.

Where the font method fails

This is the part most tutorials skip, and it is why so many spreadsheet barcodes refuse to scan.

Barcode typeType the value and apply a font?Why
Code 39Yes, with asterisksEach character has one fixed pattern
Code 128NoNeeds a start mark, a calculated checksum character and a stop mark
UPC-A and EAN-13NoLeft and right halves use different patterns, plus guard bars
ITF-14NoDigits are encoded in pairs

For those types, the text has to be converted into a special string before the font is applied. That takes a macro or an add-in, and each font family expects its own encoding. Typing 036000291452 and switching the cell to a UPC or Code 128 font gives bars that look right and do not scan.

Other limits apply even to Code 39:

  • It is wide. A 12-character SKU may not fit a small label at a size a scanner can read.
  • The font must be on every computer. Send the workbook to someone without the font and they see plain text with asterisks.
  • No quiet zone. Cell borders, fill colour or a neighbouring cell's text right next to the bars will stop a scan. Leave empty cells either side.
  • No retail use. Shops and marketplaces expect UPC or EAN on a product, not Code 39.

The quicker route for a product list

If the aim is labels, not a spreadsheet that contains barcodes, skip fonts. Keep the list in the spreadsheet and draw the barcodes outside it.

  1. Clean the column using the steps above.
  2. Copy the column. Copy a second column too if you want text, such as the product name, printed on each label.
  3. Paste into the bulk barcode generator and choose UPC-A, EAN-13 or Code 128.
  4. Read the list of rejected rows. Each one shows its line number and the reason, such as a wrong length or a check digit that does not match.
  5. Print on label sheets, or download every barcode as an image file.

The check digit is added for you if you leave it off, so the long formula is optional on this route. No font is involved, so Code 128 and UPC come out correctly encoded.

For products with no codes yet, the SKU generator turns names and options into short SKUs. Print those as Code 128 barcodes, which are narrower than Code 39 for the same text.

Sending the list to your store

The same clean column can go straight into your shop. Shopify's product CSV has a Variant Barcode column, and its bulk editor accepts a pasted column. Check that the zeros survived the export first. If you are not selling online yet, you can start a free Shopify trial and import the list. Only real, licensed UPCs belong in that field. For label size and print settings, see the guide to barcode size and printing.

Frequently asked questions

Does Excel have a built-in barcode generator?

No. Excel and Google Sheets have no barcode function. The usual options are a barcode font, an add-in, or making the images in a separate tool and keeping only the numbers in the spreadsheet.

Why does my barcode font not scan?

The usual causes are missing asterisks around a Code 39 value, lowercase letters, a font size that is too small, or no blank space beside the bars. With a Code 128 or UPC font, the cause is nearly always that the text was not converted into the encoded string the font expects.

How do I stop Excel removing the zero at the start of a UPC?

Format the column as Text before you paste the numbers. If the zeros are already gone, the formula =TEXT(A2,"000000000000") rebuilds a 12-digit number. Typing an apostrophe before the number also forces a single cell to text.

Can I make UPC barcodes with a font?

Not by typing the 12 digits and changing the font. UPC fonts need the number converted into a special character string first, usually by a macro or add-in. It is simpler to draw UPC barcodes with a generator and paste the images in.

Which barcode type should I use for my own stock labels?

Code 128. It is compact, handles letters, digits and symbols, and every modern scanner reads it. Code 39 is fine for short codes when you want the font method. Use UPC or EAN only for licensed product numbers.

Keep reading