Barcode and QR Code Lists: Build Them in a Spreadsheet
You don’t make the barcodes or QR codes yourself. Put each card’s barcode value, its QR code link or both in a column each, one row per card, and we print each card’s own codes from its row. No barcode fonts, add-ins or pictures are needed.
It works the same for membership, loyalty, gift and library cards, and for key tags. This guide shows what each column holds, how to build the values with a formula in Microsoft Excel, Google Sheets or Apple Numbers, and how to check them before you send the file.
The short versionOne row per card, and a column of its own for each code, even when the barcode matches the printed number. Ask your software supplier what the values must look like. Build them with a formula if it helps, then paste them in as values. Check the lengths and repeats, send the file and scan your proof.
What goes in a barcode column?
Each card’s number, exactly as your software expects it, sometimes with letters. The scanner passes the number on just as if someone had typed it in, so every character counts: 1, 001 and 0001 are three different barcodes.
The barcode holds only that number. A member’s name, level and renewal date stay in your software, matched to it. Gift cards with barcodes work the same way, with the balance held on the till.
So ask your software supplier before you build the list: which barcode type it reads, whether the number needs a set length or any start or end characters, and whether the system issues the numbers or can use ones you choose. Our guide to membership cards with barcodes lists the questions. If it reads any type, use Code 39: it’s the most widely supported, and the default on most of the cards we supply.
| Code | Holds | Worth knowing |
|---|---|---|
| Code 39 | Capitals, numbers, space and - . $ / + % | No small letters. The default on most of the cards we supply. |
| Code 128 | Letters, numbers and symbols | Packs digits in pairs, so a number-only code is about half the width. |
| QR code | Far more, including a web address | Read by a 2D scanner or a phone. A 1D scanner can’t read one. |
Asterisks round a number mark the start and stop of a Code 39 barcode and aren’t part of the number, so leave them out of the file.
Do I need a barcode font, an add-in or pictures?
No. We print each card’s barcode and QR code from the values in your file, so each cell should hold plain text, such as GE0427, and nothing else.
Whatever font a cell uses, we print from the characters it holds, so a barcode font adds nothing. And a CSV file keeps no fonts or pictures at all: Microsoft says a CSV saves only the text and values as they are displayed in the cells, and all formatting and graphics are lost.
One code that’s the same on every card is different: it’s part of your artwork. Make it with our free barcode generator or QR code generator and put it in your design.
Can the barcode be the same as the printed number?
Yes, and it can differ too. Either way, give the barcode a column of its own, next to the printed number in the same row. That keeps the two in step and leaves no doubt about what goes in the bars.
If they differ in any way, they must have a column each. The card can show GE-0427 for people to read, for example, while the bars hold GE0427, the form your software knows. Our guide to numbered plastic cards shows a number, its barcode and a QR code link kept in step.
A QR code gets a column of its own too, whatever it holds.
How do I make the barcode column from my card numbers?
With a formula in a spare column, pasted into the Barcode column as values. SUBSTITUTE replaces a character with another, or with nothing, so it can take out a hyphen. Still need the numbers themselves? Start with our guide to numbering a card list.
First, format the Barcode column as Text before anything goes in it, as for every column in the file. Otherwise Excel removes leading zeros and turns long numbers into scientific notation. Our guide to keeping leading zeros shows how in each app.
Then type the formula in an empty column that isn’t formatted as Text: here column C, or the next empty column if C already holds your QR code links. Excel doesn’t work out a formula typed into a Text cell: it shows the formula itself. Paste only the results into the Barcode column, because a formula left in the file is printed as the formula.
=SUBSTITUTE(A2,"-","")
In row 2 it turns GE-0427 into GE0427. The empty quotation marks at the end replace the hyphen with nothing, and because the formula gives no fourth number, every hyphen in the cell is replaced, in all three apps.
In Excel
- Click row 2 of the first empty column, C2 here, and type
=SUBSTITUTE(A2,"-",""). Press Enter. - Fill it down: drag the fill handle, the small square at the bottom right of C2, down to your last card. Or select C2 and the cells below it and press Ctrl+D.
- With the results selected, press Ctrl+C (Cmd+C on a Mac) to copy them.
- Click B2. On the Home tab, open the Paste menu and choose Values, or press Ctrl+Alt+V, then V and Enter. On a Mac, click the arrow next to Paste, then Paste Values. Microsoft says pasting values leaves the cells’ formatting alone, so column B stays Text.
- Check column B against column A, then delete column C.
In Google Sheets
- Click row 2 of the first empty column, C2 here, and type
=SUBSTITUTE(A2,"-",""). Press Enter. - Select C2 and the cells below it, down to your last card, and press Ctrl+D (Cmd+D on a Mac) to fill the formula down.
- Copy the results, click B2 and choose Edit, then Paste special, then Values only. The shortcut is Ctrl+Shift+V (Cmd+Shift+V on a Mac).
- Check column B against column A, then delete column C.
In Numbers
- Click row 2 of the first empty column, C2 here, type
=SUBSTITUTE(A2,"-","")and press Return. - Select C2 and point at its border until a yellow dot appears. Drag the dot down over the cells below, to your last card.
- Select the results in column C and choose Edit, then Copy. Click B2 and choose Edit, then Paste Formula Results (Shift-Command-V).
- Check column B against column A, then delete column C.
Small letters in the numbers?
Code 39 holds capitals, not small letters. If some numbers were typed in small letters, wrap the formula in UPPER, which turns every letter into a capital. It works the same way in all three apps:
=UPPER(
So ge-0428 becomes GE0428. We print column A as it is too, so fix it the same way: =UPPER(A2) in a spare column, filled down, then pasted back over column A as values.
How do I check the barcode values?
Look for four faults before you send the file:
- A character the code can’t hold. Code 39 takes capitals, numbers, space and - . $ / + %, so a small letter, a comma or an underscore has to go. UPPER fixes small letters, as above.
- The wrong length. LEN counts the characters in a cell, spaces included, so a value longer or shorter than the rest stands out.
- Too wide for the card. The longest value usually makes the widest barcode, but in Code 128 an odd number of digits takes extra room.
- A repeat. Two cards with the same barcode scan as the same member.
Count the characters with LEN
Type =LEN(B2) in an empty column and fill it down, as above. Every value should have the length your system expects. Then select the results: the bottom of the window can show the smallest and largest. If the minimum and maximum match, every value is the same length.
Minimum and maximum in Excel
Right-click the status bar at the bottom of the window and tick Minimum and Maximum. Excel doesn’t show them until you do.
Minimum and maximum in Google Sheets
Click Sum at the bottom right and choose Minimum. Then click the same box again, which now shows the minimum, and choose Maximum.
Minimum and maximum in Numbers
They appear at the bottom of the window as soon as you select the cells.
Correct any value that stands out. TRIM removes stray spaces in all three apps, and our guide to checking a card data file shows how, along with blank rows and other faults.
Will the longest value fit?
Each extra character makes a Code 39 barcode wider. These widths include the clear space either side:
| Barcode | At 0.33mm bars | At 0.25mm bars |
|---|---|---|
| Code 39, 6 characters | 49mm | 37mm |
| Code 39, 10 characters | 70mm | 53mm |
| Code 39, 14 characters | 91mm: too long | 69mm |
| Code 128, 10 digits | 36mm | 28mm |
| Code 128, 18 digits | 51mm | 39mm |
A key tag leaves about 39mm for the bars and their clear space: about 6 characters of Code 39, or 18 digits of Code 128, at 0.25mm bars. Code 128 packs digits in pairs, so an odd number of digits takes extra room: 18 digits fit, but 17 don’t. See how to design a key tag.
Look for repeats
In Excel, select the Barcode column and choose Home, then Conditional Formatting, Highlight Cells Rules and Duplicate Values, then click OK. Any value that appears twice is highlighted.
In Google Sheets, select the barcode values, such as B2:B251 for 250 cards, and choose Format, then Conditional formatting. Under Format cells if, choose Custom formula is, type =COUNTIF($B$2:$B$251,B2)>1 and click Done. Any value that appears twice is highlighted.
In Numbers, type =COUNTIF(B,B2) in an empty column and fill it down. It counts how many times each value appears in column B, so anything above 1 is a repeat.
What goes in a QR code column?
Each card’s own web address, one per row, in a column of its own. If a 2D scanner at your desk reads the code instead, it can hold the card’s number, just like a barcode.
Ask whoever runs your website or membership software what each card’s address should be. If every address is the same start with the card’s number on the end, one formula builds them all. The & sign joins the start, in quotation marks, to the value in B2:
="granite-edge.example/
In row 2 that gives granite-edge.example/
- Point it at a page you control. A printed code can’t be changed, but the page it opens can.
- Keep it short. A longer address makes more, smaller squares. At our QR code generator’s default settings, a 31-character address makes a code 29 squares across, and a 91-character one 41 squares. With granite-edge.example/
m/GE0427 in C2, the QR code link column, =LEN(C2)counts 29 characters, a little under the 31-character address. Our guide to QR codes on business cards has the sizes. - Nothing stray. The & sign joins exactly what’s in the cell, so a space after a value in column B ends up in the link.
- Test a few. Copy a link from the sheet into your web browser and check that the right page opens.
A QR code that’s the same on every card, such as one for your website, is part of your design at no extra cost. A different code on each card is priced on your quote. Our QR codes page has the specifications.
What should never go in a barcode or QR code?
A secret code, a PIN, or anything you wouldn’t want a stranger’s phone to read. A barcode is printed in plain sight and any phone can read one, and the same goes for a QR code, so whatever it holds isn’t secret.
On a gift card, the barcode carries the card number, and the secret code goes under a scratch-off panel, in a column of its own. Our guide to gift card codes in Excel or CSV lays that file out.
Print only what the card needs. A home address or date of birth on a card that might be lost is personal data you’re responsible for under UK GDPR. See what to put on a membership card.
A barcode or QR code can also be photographed or copied, so the security is in your system rejecting a number it shouldn’t accept.
How are the codes laid out on the card?
On a white box, with the number printed under the bars, so staff can type it in if a scan fails: ask for the number when you order. Leave the space for each code in your design, and we print each card’s own code there.
- Barcodes: black bars, never red, orange or yellow, with the narrowest bar 0.25mm or more (0.33mm is a common size), the bars at least 10mm tall, and clear space of 10 times the narrowest bar either side.
- QR codes: at least 15 x 15mm, black on a white square, with a clear border of 4 squares outside that.
- Both: 3mm inside the edge of the card, clear space included.
- Finish: Premium Matt has no glare, so barcodes scan more easily.
Our barcodes page and the size section of our membership barcodes guide go further. Designing in Canva? See names, numbers and barcodes on Canva cards.
Every card in our full colour range can carry its own code, including key tags, combo cards, event passes, RFID cards and the eco materials. On a combo card, the card and its snap-off key tag carry the same code. On white hot foil cards a code has to be the same on every card, and for the other hot foil ranges, ask us. A metallic base card can’t print a white box, so ask us about a code on one.
Will the barcodes and QR codes scan?
They should, if the type, size and contrast suit your scanner, but we can’t check that a code scans on your system, because scanners and phones differ. So test it yourself:
- Before you order, make one code of the same type with our free barcode generator or QR code generator, print it at actual size on paper and scan it. That shows whether your scanner is set for that type.
- On your proof. Every order gets a free email proof showing where the codes and numbers sit, so you can check the layout and wording before anything is printed. It shows a sample card, not every value in your list. Print it at actual size and scan it with your own scanner, or with a few phones, including an older one. The colours on the proof are a guide only.
- On real cards. For full colour cards, add a postal proof: a few identical cards posted to you, for £65 +vat, in around 5 working days. It tests the code’s type, size and contrast on your scanner, not every number in your list.
The list itself is yours to check. We print the file as it is, and our artwork check is technical: it doesn’t cover names, numbers, codes, links or spelling.
How do I save and send the file?
As an Excel file (.xlsx, or the older .xls) or a CSV, attached to an email to sales@cpcards.co.uk, even for one card. Either format is fine. In the email, tell us the barcode type your system reads and what the QR codes hold.
In Excel, send the .xlsx file, or save a copy as a CSV.
In Google Sheets, choose File, then Download, and pick Microsoft Excel (.xlsx) or the CSV option. Attach the file it downloads.
In Numbers, choose File, then Export To, then Excel or CSV, and attach the exported file.
If you save a CSV, don’t open it in Excel and save it again: Excel removes leading zeros when it opens one.
Before you attach it, check that the file holds:
- Values only: no formulas, no helper columns and nothing that isn’t printed.
- One worksheet, one row per card, with headings in row 1 and no hidden or blank rows or columns.
- The same columns in the same order as last time, if you’ve ordered before.
Keep a copy: it’s your record of which code is on which card. We print the file as it is. You can send a corrected file until you approve your proof, but once the proof is approved, no changes can be made. Our Excel file guidelines have an example file to download.
Questions & Answers
-
Do I need barcode fonts or a barcode add-in?
No. Put each card’s barcode value in a column as plain text, such as GE0427, and we print a different barcode on every card from its row. We print from the characters in each cell, whatever its font, and a CSV file keeps no fonts or pictures. For one barcode that’s the same on every card, use our free barcode generator and put it in your artwork.
-
Can the barcode be the same as the printed number?
Yes. Give the barcode a column of its own anyway, next to the printed number in the same row, so the two stay in step. They can differ too: the card can show GE-0427 while the bars hold GE0427. If they differ in any way, they must have a column each.
-
Can every card have its own QR code?
Yes. Put each card’s web address, or its number, in a QR code column, one row per card, and we print each card’s own QR code from its row. A different code on each card is priced on your quote. A QR code that’s the same on every card is part of your design, at no extra cost.
-
What should a QR code on a membership card link to?
A page you control, such as the member’s own online record or your renewal page. A printed code can’t be changed, but the page it opens can. Keep the address short, because a longer one makes more, smaller squares. Never put a secret code, a PIN or anything you wouldn’t want a stranger to read in the code itself: any phone can read it.
-
Can a barcode include letters?
Yes. Code 39 holds capitals, numbers, space and - . $ / + %, but no small letters. Code 128 holds letters, numbers and symbols. Ask your software supplier which type it reads and what the number should look like. In Excel, Google Sheets and Numbers,
=UPPER(A2)turns small letters into capitals. -
How long can a barcode be on a card?
It depends on the type and the bar width. With its clear space, Code 39 at 0.33mm bars is 49mm wide for 6 characters and 70mm for 10. At 14 characters it is 91mm, too long for a card, but at 0.25mm bars it is 69mm. Code 128 is more compact: 18 digits is 51mm at 0.33mm bars and 39mm at 0.25mm. An 86mm card has 80mm inside the safe area.
-
Will you test the barcodes before printing?
We can’t test a code on your system, because scanners and phones differ. Print your free email proof at actual size and scan it with your own scanner, or with a few phones. To test real cards, add a postal proof: a few identical cards posted to you, for £65 +vat, in around 5 working days, for full colour cards. It tests the type of code, not every number in your list.
-
How do I make a column of QR code links in Excel?
Join the fixed start of the address, in quotation marks, to each card’s value with the & sign, such as
="granite-edge.example/in an empty column. Fill it down, copy the results and paste them into your QR code column as values, so the file holds the links, not the formula. The same formula works in Google Sheets and Numbers.m/"&B2 -
Where can I get barcoded cards printed in the UK?
CP Cards supplies them, printed in England, from 25 cards, with a different barcode or QR code on every card from your spreadsheet. Every order gets a free email proof, so you can check the layout and wording before anything is printed. For a quote, email sales@cpcards.co.uk or use our quote form.
Not sure how to set out your codes?
Ask us before you order. Tell us what reads your cards and what your software supplier says the codes must hold, and we’ll tell you how to set out the file.
Email sales@cpcards.co.uk. We often reply within minutes, 9am to 5pm, Monday to Friday.

