Skip to content
Products
Developers & lookup

UPC lookup in Excel

Turn a column of UPC, EAN or ISBN numbers into product names, brands and categories. Paste a few codes, send the whole column as a file, or fill it in with Power Query.

A file costs $0.01 per barcode found. You see the match count before you pay.

First, stop Excel changing your barcodes

Excel reads a barcode as a number, and that damages it in two ways:

  • Leading zeros disappear. 049000050103 becomes 49000050103. Most UPCs sold in the United States start with a zero.
  • Long numbers turn into 8.83904E+11. Excel shows numbers of 12 digits or more this way in a General cell. The digits are still there until you save the sheet as a CSV, which keeps only what is shown.

To keep them whole, select the barcode column and set its format to Text before you type or paste codes into it. For a column that already holds numbers, set the format to Number with 0 decimal places before you copy from it or save it. To put the zero back on 12-digit UPCs, use =TEXT(A2,"000000000000") in a spare column.

The lookups below also repair the commonest case for you: an 11-digit UPC is read as the 12-digit code when the restored number has a correct check digit.

Way 1: paste up to 25 codes

Copy the cells from Excel and paste them into the box on UPC to product name. The names, brands and categories come back in a table you can copy into your sheet. It is free and needs no account.

Way 2: send the column as a file

  1. Copy the barcode column to a new sheet, formatted as Number with 0 decimal places or as Text.
  2. Save that sheet as a CSV. Choose File > Save As and pick CSV (Comma delimited).
  3. Upload it to bulk barcode lookup. A file can hold up to 100,000 barcodes.
  4. Check the match count. You see how many barcodes were found and a sample of the results before paying. The price is $0.01 per barcode found; codes not found are free.
  5. Open the results in Excel with Data > From Text/CSV. In the preview, set Data Type Detection to Do not detect data types so the barcodes stay whole.

The result file has one row per barcode, in the order they first appear in your file, with these columns: UPC, Status, Matched Barcode, Title, Brand, Category, Description and Image URL. If your list has no repeats or blanks you can paste the columns straight next to it. Otherwise match on the barcode:

=XLOOKUP(A2&"", Results!A:A&"", Results!D:D, "Not found")

Here A2 is your barcode, Results is the sheet holding the result file and column D is the product title. The &"" makes Excel compare both sides as text.

Way 3: fill the column in with Power Query

Power Query is built into Excel for Windows (Excel 2016 and later, and Microsoft 365). It calls the Barcode Report API for each row and writes the product name, brand and category next to it. You need an API key: create a free account, which includes 100 found lookups a month.

  1. Make the codes a table. Give the column the heading Barcode, click a cell in it, press Ctrl+T and tick My table has headers. On the Table Design tab, change the table name to Barcodes.
  2. Open a blank query. Choose Data > Get Data > From Other Sources > Blank Query, then Home > Advanced Editor.
  3. Paste the query below over what is there, and put your API key in place of YOUR_API_KEY. Click Done.
  4. Answer Excel's two questions. When it asks how to connect to barcodereport.com, choose Anonymous (the key travels in the query). If it asks about privacy levels, choose Public for barcodereport.com.
  5. Click Close & Load. The results arrive on a new sheet.
let
    ApiKey = "YOUR_API_KEY",
    Source = Excel.CurrentWorkbook(){[Name = "Barcodes"]}[Content],
    AsText = Table.TransformColumnTypes(Source, {{"Barcode", type text}}),
    Lookup = (code as nullable text) as record =>
        let
            Digits = Text.Select(if code = null then "" else code, {"0".."9"}),
            Full = if Text.Length(Digits) = 11 then "0" & Digits else Digits,
            Body = if Full = "" then [] else Json.Document(Web.Contents(
                "https://barcodereport.com",
                [
                    RelativePath = "api/v2/products/" & Full,
                    Headers = [#"X-API-Key" = ApiKey],
                    ManualStatusHandling = {400, 404}
                ]
            )),
            Found = Record.FieldOrDefault(Body, "found", false) = true,
            Item = if Found then Body[product] else []
        in
            [
                Product = if Found then Item[title] else if Full = "" then null else "Not found",
                Brand = Record.FieldOrDefault(Item, "brand", null),
                Category = Record.FieldOrDefault(Item, "category", null)
            ],
    Looked = Table.AddColumn(AsText, "Result", each Lookup([Barcode])),
    Result = Table.ExpandRecordColumn(Looked, "Result", {"Product", "Brand", "Category"})
in
    Result
  • Each product found uses one lookup. Codes that are not found are free.
  • A refresh looks every code up again. To keep the results without spending lookups, copy them and use Paste Special > Values.
  • If Excel shows a Formula.Firewall message, open Data > Get Data > Query Options, and under Current Workbook > Privacy choose to ignore the privacy levels for this workbook.
  • The key is saved in the workbook. Anyone who can open the query can read it, so take it out before you share the file.
  • For more than a few hundred codes, the file route is quicker: the query sends one request per row and slows down when it reaches your plan's per-minute limit.

More fields, such as description, image address and the barcode in its other forms, are listed in the API documentation.

Using Google Sheets instead?

Sheets can do this with a formula. The free =BARCODELOOKUP() function fills in names for a whole column, with the same API key.

UPC lookup in Excel FAQ

Is there an Excel formula for UPC lookup?

Excel has no built-in barcode lookup, and its formulas cannot read the JSON that a lookup API returns. The two ways that work are to send the column as a file and paste the results back, or to use Power Query, which fills in product names next to your codes and can be refreshed.

Why did Excel change my UPC to 4.9E+10 or drop the zero at the front?

Excel treats a barcode as a number. It removes leading zeros and shows numbers of 12 digits or more in scientific notation. Format the column as Text before typing or pasting codes, or as Number with no decimal places before saving a file.

What does it cost?

Pasting up to 25 codes is free. A file through bulk lookup costs $0.01 per barcode found, with the match count shown before you pay; codes not found are free. Power Query uses an API key: 100 found lookups a month are free, and paid plans start at $24.95 a month for 10,000.

How many barcodes can I look up at once?

A file can hold up to 100,000 barcodes. Power Query sends one request per row, which suits a few hundred codes; for longer lists the file route is quicker.

Does it work for EAN and ISBN numbers?

Yes. UPC-A, EAN-13 and ISBN numbers all work, and a UPC that lost its leading zero is recognised when the restored number has a correct check digit.

Does this work in Google Sheets?

Sheets has its own route: a free =BARCODELOOKUP() function that fills in product names from a formula.