EAN Check.comEAN Check.com

UPC-E Converter

Got a short barcode from a candy bar or a yogurt cup and a form that wants 12 digits? Type the UPC-E to get the full UPC-A, or type a UPC-A to see if it has a UPC-E form.

By The eancheck teamPublished

One code per line, so you can paste a column from a spreadsheet. On a line with tabs or commas, the one field that looks like a code is used. Everything runs in your browser.

Converts both ways: UPC-E to UPC-A, and UPC-A to UPC-E when the number has one.

Using an AI assistant?

A UPC-E is a UPC-A with the zeros left out

A UPC-E barcode carries the same 12-digit number as a UPC-A, but it leaves four or five zeros out of the bars. GS1 calls this zero suppression, so a UPC-E is a zero-suppressed UPC-A. That makes it a little over half as wide: 51 modules against 95 for a UPC-A, not counting the quiet zones. A module is the width of the narrowest bar, and the quiet zones are the blank margins a scanner needs on the left and right. GS1 US names candy, cosmetics, yogurt cups and trial-size items as the places you see it most.

Under the bars you read 8 digits, such as 0 123455 8. Only the six in the middle are bar characters. The 0 in front is the first digit of the UPC-A. The last digit is the check digit, and it has no bars of its own: the scanner works it out from the pattern of the six characters. The GS1 General Specifications say there is no six-digit UPC-E barcode. Behind it is always a 12-digit number: a GTIN-12, or for in-store numbers an RCN-12.

How to convert UPC-E to UPC-A: four rules, picked by the last digit

Look at the last of the six digits: it says where the four or five zeros go back in, and the four cases below show where. The UPC-A digits are counted from 1 (the leading 0) to 12 (the check digit). These are the four worked examples from section 5.2.2.4.1 of the GS1 General Specifications, Release 26.0.

Take the first row. The UPC-A 034000005673 has zeros in digits 5 to 8. They are left out, digit 4 (a 0) moves to the end, and the six digits read 345670. A scanner that reads a final 0 knows to put that digit back in place 4 and refill four zeros after it.

The rules do not overlap, so a UPC-A has at most one UPC-E form. A number that fits none of them, such as 036000291452, can only be printed as a UPC-A. GS1 also requires the UPC-A to start with 0.

GS1 says the 8 digits must become 12 before a system uses them

GS1 says the barcode reader or the software behind it must expand a UPC-E to its full 12 digits before it uses it. So the price file at the till, the stock list in the back office and a marketplace listing should all hold the 12-digit UPC-A, not the 8 printed digits.

A form that takes 8 digits stores the wrong number

This trips people up when a small pack has only a UPC-E on it. Type the 8 digits into a form that checks them as a GTIN-8, and the form will often accept them. By our count with the converter's own code, 58 in 100 UPC-Es pass the GTIN-8 check digit test by coincidence, among them every UPC-E whose six digits end in 5 to 9, and GS1's own example 01234558. The form then stores a GTIN-8 that belongs to no product. GS1 issues no EAN-8 product number that starts with 0: it keeps those 8-digit numbers for codes a shop makes for its own stock. Convert the UPC-E first and enter the UPC-A. To check a whole column of numbers afterwards, paste it into the check digit calculator.

Scanners that send 8 digits, or 12

A scanner sends a UPC-E in whichever form its settings ask for. In Zebra's DS2208 Product Reference Guide (October 2025), the setting is called Convert UPC-E to UPC-A, and it is off by default. Left off, the scanner sends the 8 digits under the bars. Switched on, it sends the 12-digit UPC-A. Two more settings, UPC-E Preamble and Transmit UPC-E Check Digit, can leave out the leading 0 or the check digit, which is how a scanner ends up sending 7 or 6 digits. The converter reads all of these lengths, but it reads 7 digits that start with 0 or 1 as the leading digit and six digits. So if your scanner drops the leading 0, type the 0 in front: without it, 1 in 5 codes come out as a different UPC-A, by our count. If your stock system wants 12 digits, switch the conversion on in the scanner instead of retyping codes.

Old forms and in-store numbers

Forms GS1 allowed in earlier specifications

Some six-digit bodies expand to a valid UPC-A but break today's rules. One example is 01230055: it expands to 012300000055, which under the current rules is written 01230535. Section 7.10 of the GS1 General Specifications marks these forms as valid in previous specifications and says scanners must still accept them when they read a barcode. Do not print them on a new pack. The converter flags them and gives the current form. Of the one million possible six-digit bodies, 86 500 are such old forms, by our count with the converter's own code.

Numbers for use inside one company

GS1 keeps a small range of UPC-E numbers, behind the U.P.C. Company Prefixes 000000 and 001000 to 007999, for codes a shop or a company makes for its own stock. GS1 calls the 12-digit number behind them an RCN-12, a Restricted Circulation Number. They are not unique: the same code can mean a different product in another shop. The converter labels them, and it expands them with the same rules.

A new product cannot get a UPC-E from GS1 US

GS1 US no longer licenses UPC-E prefixes. It says it has other options instead: a company prefix or a single GTIN. Both give a new brand a UPC-A, and that number almost never has the zeros a UPC-E needs. If the pack is small, print the UPC-A smaller: GS1 allows 80% of full size. The UPC-A barcode generator shows the printed size at each magnification, in millimetres, or in inches if you change the unit in its settings. If even 80% does not fit, put the barcode on a hang tag or the outer pack.

Convert UPC-E to UPC-A in Excel or Google Sheets

Put the 8-digit UPC-E in A2 and this formula in B2, then fill it down the column. Format column A as text before you paste the codes (Text in Excel, Plain text in Google Sheets). Both programs otherwise turn 01234558 into 1234558, and the result is wrong.

=LEFT(A2,3)&CHOOSE(1+(VALUE(MID(A2,7,1))>2)+(VALUE(MID(A2,7,1))>3)+(VALUE(MID(A2,7,1))>4),MID(A2,7,1)&"0000"&MID(A2,4,3),MID(A2,4,1)&"00000"&MID(A2,5,2),MID(A2,4,2)&"00000"&MID(A2,6,1),MID(A2,4,3)&"0000"&MID(A2,7,1))&RIGHT(A2,1)

The formula uses only LEFT, MID, RIGHT, CHOOSE and VALUE, which both programs have. If your spreadsheet writes decimals with a comma, as Excel and Google Sheets do in many European languages, it wants semicolons between the arguments: replace each comma in the formula with a semicolon. We ran the formula in HyperFormula, an open-source spreadsheet engine, on all one million UPC-Es that start with 0 and have the right check digit, and it matched the converter on every one. We have not run it in Excel or Google Sheets themselves. It copies the check digit without checking it, so a typo in the UPC-E stays in the UPC-A. Paste the finished column into the check digit calculator to catch those.

To convert a list without a spreadsheet, switch the converter above to A list and paste one code per line, or a column copied from a sheet. Every line gets its own row, blank lines too, so the copied columns paste back next to your list. Quotes, and the apostrophe Excel puts in front of a text cell, are removed. A Note column flags the codes worth a second look, such as a leading 1 that may be a lost 0. Both downloads keep the leading zeros: the .xlsx stores the codes as text, and the CSV writes them in a form Excel opens as text.

Converting UPC-E in code

The expansion is a lookup on the last digit, and the compression tests the four conditions from the table. These functions follow the same rules the converter uses. Add the check digit with the GS1 mod-10 calculation over the 11 digits, and compare it with the last printed digit.

// body = the six digits between the guards, e.g. "123455"
function expandUpcE(body) {
  const [a, b, c, d, e, last] = body
  if (last <= "2") return "0" + a + b + last + "0000" + c + d + e
  if (last === "3") return "0" + a + b + c + "00000" + d + e
  if (last === "4") return "0" + a + b + c + d + "00000" + e
  return "0" + a + b + c + d + e + "0000" + last
}

// u = the first 11 digits of a UPC-A; returns the six digits or null.
// Test in this order: each test assumes the ones above it failed.
function compressUpcA(u) {
  if (u[0] !== "0") return null
  if (u[3] <= "2" && u.slice(4, 8) === "0000") return u.slice(1, 3) + u.slice(8) + u[3]
  if (u.slice(4, 9) === "00000") return u.slice(1, 4) + u.slice(9) + "3"
  if (u.slice(5, 10) === "00000") return u.slice(1, 5) + u[10] + "4"
  if (u.slice(6, 10) === "0000" && u[10] >= "5") return u.slice(1, 6) + u[10]
  return null
}

// GS1 mod-10: weight 3 on the rightmost digit, then 1, 3, 1 and so on
function checkDigit(digits) {
  let sum = 0
  for (let i = 0; i < digits.length; i++) {
    sum += Number(digits[digits.length - 1 - i]) * (i % 2 === 0 ? 3 : 1)
  }
  return String((10 - (sum % 10)) % 10)
}

// expandUpcE("123455") === "01234500005"
// compressUpcA("01234500005") === "123455"
// checkDigit("01234500005") === "8"

For a full identification of any code, not only UPC, use the barcode identifier.

Frequently asked questions

What is the difference between UPC-A and UPC-E?

The number is the same; the barcode is shorter. A UPC-E carries a 12-digit UPC-A with four or five zeros left out of the bars, so it is 51 modules wide against 95. Only a UPC-A that starts with 0 and has its zeros in one of four GS1 patterns has a UPC-E form, and a scanner or the software behind it turns the UPC-E back into the 12 digits.

Can I enter the 8 digits of a UPC-E in a GTIN-8 field?

No. The 8 printed digits are not a GTIN-8, and the risk is that the form takes them anyway: 58 in 100 UPC-Es pass the GTIN-8 check digit test by coincidence, by our count, so the field stores a number no product has. GS1 issues no GTIN-8 that starts with 0; it keeps those for in-store codes. Expand the UPC-E with the UPC-E converter and enter the 12-digit UPC-A.

Can every UPC-A be converted to UPC-E?

No. Only a UPC-A that starts with 0 and has four or five zeros in one of four fixed places has a UPC-E form. 036000291452, for example, has zeros in the wrong places, so it can only be printed as a UPC-A. The UPC-E converter lists the four GS1 rules and, under each one, the UPC-A positions that break it.

Is the check digit the same in UPC-E and UPC-A?

Yes. A UPC-E and its UPC-A share one check digit, calculated with the GS1 mod-10 method over the 12-digit UPC-A. In the UPC-E barcode the check digit has no bars of its own. GS1 encodes it in the pattern of odd and even characters among the six digits, and the scanner works it out from that pattern.

What is the difference between UPC-E and EAN-8?

A UPC-E is a 12-digit UPC-A written short, and it is expanded back to 12 digits before use. An EAN-8 is a number of its own, a GTIN-8, issued by a GS1 office for very small packs, with no longer form. Both print 8 digits, but an EAN-8 shows them in two groups of four. An EAN-8 barcode whose number starts with 0 carries a shop's in-store code, which GS1 warns can be mistaken for a UPC-E.

Can a UPC-E start with 1?

Not under the GS1 General Specifications, which say the first digit of the number behind a UPC-E shall always be zero. A barcode that prints a 1 there is outside the standard, and a till may refuse it. The UPC-E converter still expands a code that starts with 1, using the same four rules, and adds a warning. Eight such digits may also be an EAN-8, which GS1 issues from 100 to 199, so check whether the pack prints them in two groups of four.

Do I type the UPC-E or the UPC-A into a product database?

The UPC-A. GS1 says a UPC-E must be expanded to its full 12 digits before any system works with it, so a till, a stock list or a marketplace should store the 12 digits. If a form allows 14 digits, add two zeros in front. Never store the 8 printed digits as the product number.

By The eancheck teamPublished

Questions or corrections? Email the eancheck team.