Guides ·

How to scan barcodes into Excel

Stock counts, goods receiving and returns all end the same way: a pile of barcodes that should be rows in a spreadsheet. This post shows three ways to get them into Excel, the one setting that keeps codes intact, and how long GS1 codes become separate columns.

Open your label photos or PDFs on the free Scan barcodes to Excel page and download one sheet with a row per code.Try it on your own file
The Scan barcodes to Excel page with the moon base pantry PDF: a page thumbnail with 6 numbered codes, each code decoded with its fields, and 6 codes found, 6 OK on the right
moon-base-pantry-stock-count.pdf on the Scan barcodes to Excel page: 6 codes, each with its fields and checks. Sample sheet: unmake's own, all products made up.

Three ways in

A handheld scanner types each code into the cell you clicked. A phone can read codes with its camera. Or you photograph the labels, or take the PDF they were printed from, and let a program read every code at once. All three should end the same way: one row per code.

Which one fits depends on the pile. For a few codes at a desk, a scanner is quickest. For labels on shelves and pallets, photos save carrying a laptop around. For label proofs that exist only as a PDF, reading the PDF needs no printing.

With a USB or Bluetooth scanner

Most handheld scanners behave like a keyboard: they send each code as keystrokes to whatever has focus, so Excel can't tell a scan from typing. Many can add an Enter key after the code, which moves Excel one row down so the next scan lands below. Zebra, for example, lists this as a setting called Enter Key.

Click the first empty cell of a column, scan, and the column fills. Nothing needs installing, but you only get the raw code: no product name, no check and no split into fields. To split codes you already scanned, paste them into Type codes on the Scan barcodes to Excel page described below: it reads the raw string as a scanner types it, so 01095011015300101727063010LUNA42 comes back as GTIN, expiry and batch.

Set the column to Text before you scan

Excel treats a scanned code like any number you type. A UPC that starts with 0 loses it, and anything longer than 15 digits is rounded: an 18-digit SSCC, the serial number of a pallet, ends in zeros. Microsoft documents both: leading zeros are removed, and digits after the 15th become zero.

So select the column, choose Format Cells > Text, and only then scan. Formatting afterwards doesn't bring the digits back.

The same scanned 18-digit SSCC in two Excel cells: in a General cell it becomes the number 95011015300000000, losing the leading 0 and the last two digits; in a Text cell it stays 095011015300000010
The same scan in a General cell and in a Text cell. Diagram: unmake.

GS1 codes arrive as one long string

Codes on cartons and pallets often carry several values: product number, expiry date, batch. Scanned into a cell, they come out as one string such as 01095011015300101727063010LUNA42, where 01, 17 and 10 are GS1 application identifiers that say what each following value is.

Some values have no fixed length, so the code puts an invisible separator after them. GS1's own specification warns that receiving systems may turn that character into something else, and Zebra's keyboard-mode scanners, for example, have a setting to replace it with a chosen key. Splitting such strings with formulas is fiddly; a reader that knows the GS1 rules does it for you.

From photos or a PDF, all at once

The Scan barcodes to Excel page on unmake reads every barcode in the photos, scans and PDFs you open, in your browser; nothing is uploaded. Each code becomes a row with the file, page, code type, content and a status. GS1 codes also get their own columns: GTIN (the product number), batch, expiry, best before, serial, SSCC and more.

Click Excel to download the sheet. Codes are stored as text, so leading zeros and long numbers stay exactly as scanned. A CSV is under Other formats, with a warning that Excel drops leading zeros when you double-click it. On a phone, open the same page and photograph the labels, or use its Camera button to scan them live; the example below uses a PDF.

Check the sheet before you count

A row is only as good as the label. The page checks check digits, dates, lengths and GS1 rules and sorts the codes into OK, to check and with problems. A wrong check digit is named together with the digit it should be.

In Excel, filter the status column before you use the numbers. And for hard labels, the page's own tips are worth following: fill the frame with the code, hold the phone parallel to the label and avoid glare.

A worked example: a moon base pantry stock count

  1. The file: moon-base-pantry-stock-count.pdf (129 KB, one A4 page), a made-up stock sheet with 6 codes: an EAN-13 on freeze-dried strawberries, a GS1-128 on astronaut ice cream, a GS1 DataMatrix on space ramen, a GS1-128 pallet label (SSCC), a Code 128 shelf-bin label and a QR code.
  2. Open files, then the PDF: 6 codes found, 6 OK, 0 to check, 0 with problems. A thumbnail of the page shows a numbered marker on each code.
  3. The ice cream code reads (01)09501101530010(17)270630(10)LUNA42: GTIN 09501101530010 with check digit OK, expiry date 2027-06-30, batch LUNA42.
  4. The ramen DataMatrix adds a serial number, 000123, and the pallet label carries the SSCC 095011015300000010; both keep their leading zeros.
  5. Excel saved barcodes-2026-12-01.xlsx, named with the day's date (3,341 bytes): a header row plus one row per code, 18 columns. The EAN-13 2001234500012 appears in the gtin column as 02001234500012, the 14-digit form GS1 uses.
  6. Other formats, then CSV, saved the same rows as a 788-byte file.

Common mistakes

Questions

Do I need a special scanner for Excel?

No. A scanner that works as a keyboard types into Excel the same way it types into any other program.

Can Excel show the product name for a barcode?

Not by itself. A GTIN is only a number; the name comes from your own product list, which you can match with a lookup formula such as XLOOKUP. The page doesn't look up names either.

Why does my GTIN have a 0 in front in the sheet?

The sheet writes every product number in the 14-digit form GS1 uses after (01): a 13-digit EAN gets one zero in front and a 12-digit UPC gets two.

Sample file: moon-base-pantry-stock-count.pdf (made-up stock sheet, 6 barcodes) · ours (unmake sample; codes drawn with bwip-js, MIT; all products and numbers made up)

Sources

Open your label photos or PDFs on the free Scan barcodes to Excel page and download one sheet with a row per code.Try it on your own file