CodeCraft — free QR code and barcode tools

Type a number or text — the barcode appears instantly

Any letters, digits or symbols. Variable length.

Pick a colour

More options format, background, text
Changing format may need a different value — use the sample button below.
Show the value under the barsRequired on most retail packaging

Understanding barcodes before you print them

Sixteen formats sound like a lot of choice. In practice the right one is usually decided for you by where the label is going.

A linear barcode stores information in the relative widths of bars and spaces along a single axis. A scanner sweeps a beam across it, measures how long each light and dark region lasts, and converts that rhythm back into characters. Because only the ratios matter, the same barcode works whether it is 2 cm wide on a jar or 20 cm wide on a pallet label — provided it is printed sharply and not squeezed horizontally.

The first commercial barcode was scanned in 1974 on a packet of chewing gum in Ohio. Everything since has been refinement: denser encodings, better error checking, and international agreement on who owns which numbers. That last point is the one that catches people out, so it is worth stating plainly here.

Before you print a retail barcode: EAN and UPC numbers are issued by GS1, the global standards body. A shop's till will reject a number that is not registered to you. This tool renders the bars for a number you already hold — it cannot allocate one. For internal stock, asset tracking or logistics you own the numbering scheme yourself, so no registration is involved at all.

Every format, and what it is for

FormatAcceptsWhere you see it
EAN-1312 or 13 digitsRetail products everywhere outside North America
EAN-87 or 8 digitsSmall packs where EAN-13 will not fit
UPC-A11 or 12 digitsRetail products in the USA and Canada
UPC-E6–8 digitsCompressed UPC for very small packaging
Code 128Any ASCII characterShipping, warehousing, asset tags — the workhorse
Code 128 CDigits in pairsThe densest numeric option; even-length only
ITF-1413 or 14 digitsOuter cartons and shipping cases
Code 39A–Z, 0–9, - . $ / + %Defence, automotive, older scanning hardware
MSIDigits onlyShelf-edge labels and stock rotation
CodabarDigits, - $ : / . +Libraries, blood banks, photo labs
PharmacodeNumber 3–131070Pharmaceutical packaging checks

Check digits, explained once

Most numeric formats end in a digit that is calculated rather than chosen. The scanner recomputes it from the other digits on every read and throws the scan away if it disagrees. That single digit is why a misread barcode almost never produces the wrong product rather than no product.

You do not need to work it out. Type the 12 digits of an EAN-13 and the thirteenth is appended for you; type all 13 and it is verified instead. The same applies to UPC-A, ITF-14 and the MSI variants.

Printing sizes that survive a real scanner

  • Never scale horizontally on its own. The bar-to-space ratio is the data. Stretching one axis destroys it. Resize proportionally or, better, export SVG and set the width in your layout program.
  • Respect the quiet zone. Leave at least ten module widths of blank space either side. Cropping tight to the bars is the single most common reason a label fails at the till.
  • EAN-13 has a nominal size. The standard is 37.29 mm × 25.93 mm, and shops accept roughly 80% to 200% of that. Below 80% you are gambling.
  • Print dark on light. Red bars are effectively invisible to a classic red laser scanner. Black, dark blue, dark green and dark brown are all safe.
  • Avoid glossy laminate directly over the code where you can. Reflections scatter the beam and cause intermittent failures that are maddening to debug.

PNG, JPG or SVG?

Download the SVG whenever the barcode is going to a printer. It is a vector description of the bars, so it reproduces at the exact edge sharpness the output device can manage, at any size, with a file measured in kilobytes. Every serious print workflow accepts it.

Use PNG for screens, internal documents and e-commerce listings, exporting at 4× if it will be printed from a word processor. Use JPG only when a system refuses everything else: its compression blurs precisely the hard bar edges that the scanner measures, and the artefacts get worse the smaller the code.

A quick decision guide

01Selling in a shop

Get a GS1 prefix, then render your allocated number as EAN-13, or UPC-A if you are selling in North America. Keep it at or above 80% of nominal size and leave the printed digits visible underneath.

02Tracking your own stock

Code 128 with your own reference scheme. No registration, no fees, accepts letters and digits, and produces the shortest code for a given amount of data.

03Labelling shipping cartons

ITF-14 on the outer case. It is designed to survive corrugated cardboard printing, where fine bars smear, so it uses thicker elements than a retail code.

04Working with old hardware

Code 39. It is bulky and inefficient but almost universally readable, which is why it persists in defence, automotive and legacy warehouse systems.

Barcode or QR code?

A linear barcode holds tens of characters and is read by dedicated hardware at a till or in a warehouse. A QR code holds thousands and is read by any phone camera. If a member of the public is meant to scan it, use a QR code. If a scanner gun or a point-of-sale system is meant to scan it, use a barcode. For anything printed at volume, the bulk generator will produce either kind in batches of up to 300 at once.

Frequently asked questions

Can I use these barcodes on products I sell?

For internal use, asset tags, stock control and logistics — yes, without restriction. For a product on a retail shelf you first need a number licensed from GS1, because the till checks the number against a registry. Once you hold that number, rendering it here is perfectly legitimate and the resulting image is yours to use commercially.

Why does the field turn red when I type?

Each format accepts a specific alphabet and length. EAN-13 wants 12 or 13 digits and nothing else; Code 128 C needs an even count of digits; Codabar must start and end with a letter from A to D. The message under the preview names the exact rule for whichever format is selected, and the "Insert a valid sample" button fills in a known-good value you can edit.

Do I need to add the check digit myself?

No. Leave it off and it is calculated and appended automatically. If you include it, it is verified instead, so a typo somewhere in the number is caught before you print a thousand labels.

My printed barcode will not scan. What now?

Work through it in this order: print at 100% scale with no "fit to page" shrinking; confirm the white margin either side is intact; increase the bar width setting and reprint; switch from PNG to SVG; and check the bars are genuinely dark rather than a mid-tone colour. In the large majority of cases the cause is scaling or a cropped quiet zone.

Is there a limit on how many I can generate?

No limit, no account and no watermark. For batches, the bulk generator takes a pasted list or CSV and returns every barcode in one ZIP, plus an optional A4 print sheet.

Does my data get uploaded anywhere?

No. The barcode is drawn by JavaScript running in your browser. Product codes, references and anything else you type stay on your own device.