▦ QR & barcodes

Barcode generator: make Code 128, EAN-13, UPC-A and more

Choose the barcode type, type the value, and download the barcode as SVG or PNG. Check digits are calculated and checked for you.

Free · no signup Runs in your browser

StatusType a value

How do I make a barcode online?

Choose the type (Code 128 takes any text; EAN-13 and UPC-A are for retail products), type the number or text and the barcode appears at once. Change the width, height, colours and whether the number is printed under it, then download it as SVG for print or PNG for screens. For EAN and UPC codes, type the digits without the last one and the check digit is added; if you type all digits, it is checked, and an invalid number is rejected.

Why we built this tool

Barcodes are used for much more than checkout counters: inventory labels, shelf and bin numbers, asset tags, library cards, ticket and badge IDs, shipping references, and school and event passes. Making one should not need a paid subscription or an account, nor should you have to trust a site that uploads the number you type, which may be an internal part number or a customer reference. This generator draws the barcode in your browser, supports the main formats, checks that the value is valid for the format, works out check digits, and gives you a crisp vector SVG for printing as well as a PNG.

The barcode is drawn in your browser. Nothing is uploaded, and there is no watermark.

How it works in detail

A barcode turns characters into a pattern of bars and spaces of different widths, which a scanner reads as a line of light and dark. Each format has its own rules. Code 128 can encode all 128 ASCII characters, and switches between three code sets so that long runs of digits are packed two to a bar group; it ends with a check character and a stop pattern, so scanners can detect misreads. EAN-13 and UPC-A encode digits only, in 7-module groups drawn from three tables (left odd, left even and right), with start, middle and end guard bars; the thirteenth digit, the check digit, is calculated from the other twelve: add the digits in the odd positions, add three times the digits in the even positions, and the check digit is whatever brings the total up to the next multiple of ten. A UPC-A code is the same as an EAN-13 with a leading zero. Code 39 uses nine elements per character, three of them wide. ITF-14 is used on cartons.

The drawing is made with the JsBarcode library. The tool shows the value that was actually encoded, so you can see the check digit it added. SVG is exact at any size; PNG is drawn at twice the preview resolution.

How to use it

  • Choose the type. If you are unsure, use Code 128 for internal use and EAN-13 or UPC-A only for retail product codes you have been given.
  • Type the value. The hint under the box says what the type accepts.
  • Set the bar width and height, margin and colours. Keep dark bars on a light background.
  • Check the printed number under the bars, then download SVG (for printing and design) or PNG.
  • Print it at a good size and scan it before you print many: a scanner or the QR and barcode scanner tool can check it.

Which barcode should I use?

A short guide to the formats on this page.

Barcode types
TypeWhat it can holdTypical use
Code 128Any letters, digits and symbolsShipping labels, inventory, asset tags, internal IDs
EAN-1313 digitsRetail products worldwide
UPC-A12 digitsRetail products in Canada and the United States
EAN-88 digitsSmall packages
Code 39Capital letters, digits and a few symbolsIndustry, defence, ID badges
ITF-1414 digitsCartons and cases of products
Interleaved 2 of 5An even number of digitsWarehouse and distribution
MSIDigitsShelf labels in warehouses and stores
PharmacodeA number from 3 to 131,070Pharmaceutical packaging
CodabarDigits and a few symbolsLibraries, blood banks, parcels

Use cases

  • Inventory, bin and shelf labels
  • Asset tags and equipment IDs
  • Event tickets, passes and badges
  • Library and membership cards
  • Shipping and return references
  • Teaching how barcodes and check digits work

Problems you may run into

Most trouble is about the number and the printing.

Problems you may run into, and what to do
What you seeLikely causeWhat to do
'That value does not fit this barcode'Wrong length, a letter in a digits-only type, or a wrong check digitFollow the hint; for EAN and UPC give all digits except the last, or a correct full number
The scanner will not read itToo small, low contrast, a smudged print or no blank marginPrint larger, dark on light, keep the margin, use a good printer
My EAN-13 is accepted at home but rejected by a retailerRetail barcodes must use a registered company prefixIn Canada, get your prefix from GS1 Canada; do not invent product numbers
The number under the bars is different from what I typedA check digit was addedThat is normal for EAN and UPC when you type one digit fewer
The PNG looks soft when printedPNG is made of pixelsUse the SVG for print, which is exact at any size
The barcode has no text under itThe text option is offTick 'Show the number under the barcode'

Retail product barcodes are not free-for-all

Anyone can make a Code 128 barcode for their own system, but a barcode on a product sold through retailers must carry a globally unique number (a GTIN) built from a company prefix that is licensed from GS1, the standards body. In Canada that organization is GS1 Canada. Making up an EAN or UPC number can clash with someone else's product and will be rejected by many retailers and marketplaces. Use this tool to draw a barcode for a number you are entitled to use, and for internal purposes.

How it works

Everything runs in your browser.

  • 1. You choose the type and type the value; the tool checks it against the type's rules.
  • 2. For EAN, UPC and ITF-14 the check digit is worked out (odd-position digits × 1 plus even-position digits × 3; add whatever reaches the next ten).
  • 3. The value becomes a pattern of bars and spaces, with guard or start and stop patterns, drawn as SVG.
  • 4. SVG or PNG is saved from the drawing. Nothing is uploaded.

Drawing is by JsBarcode 3.11.6 (MIT). Check digits follow the GS1 method for EAN-13, UPC-A, EAN-8 and ITF-14. Code 128 includes its own check character. Always test a barcode with the scanner that will read it, at the size you will print it.

Example: an EAN-13 check digit

The first twelve digits are 590123412345.

  1. Odd positions5 + 0 + 2 + 4 + 2 + 4 = 17
  2. Even positions × 3(9 + 1 + 3 + 1 + 3 + 5) × 3 = 22 × 3 = 66
  3. Total17 + 66 = 83; the next multiple of 10 is 90
  4. Check digit90 − 83 = 7

5901234123457

Type the first twelve digits and the tool adds the 7.

Terms on this page

Check digit
A final digit calculated from the others so that a scanner can detect a misread.
GTIN
Global Trade Item Number: the number encoded in a retail product barcode.
Quiet zone
The blank margin around a barcode that a scanner needs in order to read it.

Common questions

Is it free, and is anything uploaded?

It is free, and the barcode is drawn in your browser. Nothing you type is sent anywhere.

What is the best barcode for inventory?

Code 128 is the usual choice: it takes letters and digits and has error checking.

Can I make a UPC for my product?

You can draw one, but a retail product needs a number licensed from GS1 (GS1 Canada in Canada).

How do I make an EAN-13?

Type 12 digits and the tool adds the check digit, or type 13 digits and it checks them.

SVG or PNG?

SVG for printing and design, because it stays sharp at any size; PNG for screens and documents.

How big should I print it?

At least 80% of the nominal size for retail codes; larger is safer. Test it with your scanner.

Can I scan the barcode I made?

Yes, with the QR code and barcode scanner on this site in browsers that read barcodes, or with a handheld scanner.

Is anything I enter sent to a server?

No. The calculation happens in your browser and nothing you type leaves your device.

Where these numbers come from

Last verified 2026-10-25 The method on this page is checked against the sources above at least once a year. Spotted something out of date? Tell us and we will fix it.

▦ QR code and barcode tools

Create QR codes and barcodes in your browser, and scan them with a camera or a picture. Nothing is uploaded or logged.

See all 3 tools in this section