Skip to content

Barcode generator — Code 128, EAN, UPC, ITF and more

Generate Code 128, Code 39, EAN-13, EAN-8, UPC-A, ITF-14, MSI, Pharmacode and Codabar barcodes with check digits, print sizing and PNG or SVG export.

  • Runs in your browser
  • Nothing you enter is sent
  • Free, no account
Barcode
The general-purpose workhorse: every ASCII character, automatically switched between three sub-sets for the shortest possible symbol.

All 128 ASCII characters · Any length

Preview
Bars
px

The width of the narrowest bar. Retail scanners want at least 0.264 mm — which is roughly 2 px at 200 dpi, or 1 px at 96 dpi on screen.

px
px

Blank space around the symbol. EAN and UPC need at least ten narrow bars’ worth on the left and right or the scan fails.

Laser scanners read red light. Red or orange bars on white are effectively invisible to them — keep the bars dark.

Human-readable text

Required for retail EAN and UPC codes so a cashier can key the number by hand.

Leave blank to print the encoded value. Anything you type here is shown but not encoded.

Font
Text position
px
px

How to generate a barcode

  1. Pick the symbology. If you are not sure, Code 128 is right for anything used inside your own systems.
  2. Type the value. The validator checks it against the rules of that symbology and explains anything it rejects, rather than silently drawing a code that will not scan.
  3. For EAN, UPC and ITF-14, enter the number without the check digit and it is calculated for you. Paste the full number instead and it is verified.
  4. Set the bar width and height for your medium, then export the SVG for print or the 4× PNG for a label printer.

Choosing a symbology

Symbology Character set Length Where you meet it
Code 128All 128 ASCII charactersAnyShipping labels, GS1-128, asset tags, warehouses
Code 39A–Z, 0–9, space, - . $ / + %AnyDefence, automotive, older badge systems
EAN-13Digits12 + check digitRetail outside North America, ISBN-13
EAN-8Digits7 + check digitSmall packaging where EAN-13 will not fit
UPC-ADigits11 + check digitRetail in the US and Canada
ITF-14Digits13 + check digitCases, cartons and pallets
MSI PlesseyDigitsAnySupermarket shelf edges, warehouse racking
PharmacodeA number, 3–131070—Medicine cartons and package inserts
CodabarDigits, - $ : / . +, A–D start/stopAnyBlood banks, libraries, photo labs, waybills

Code 128 is more compact than Code 39 for the same content — around 30% narrower — because it switches between three character sub-sets automatically and packs pairs of digits into a single symbol character in set C. Unless you are feeding a system that specifically requires Code 39, prefer Code 128.

How the check digit works

EAN-8, EAN-13, UPC-A and ITF-14 all use the same modulo-10 scheme. Reading the payload from the right, digits alternate between weights of 3 and 1; the weighted digits are summed, and the check digit is whatever brings that sum up to the next multiple of ten.

Payload      5 9 0 1 2 3 4 1 2 3 4 5
Weights      1 3 1 3 1 3 1 3 1 3 1 3
Products     5 27 0 3 2 9 4 3 2 9 4 15   → sum 83
Check digit  (10 − 83 mod 10) mod 10 = 7
Full code    5901234123457

That single digit catches every single-digit error and most transpositions, which is why a scanner can be trusted not to silently read one product as another. If you paste a full number and the tool tells you the check digit is wrong, the number is wrong — do not “fix” it by changing the last digit unless you know the first twelve are correct.

Printing barcodes that actually scan

  • Narrow bar width (X-dimension) is the number that matters. Retail EAN and UPC require at least 0.264 mm. At 300 dpi that is about three printer dots — print any smaller and the bars merge.
  • Never scale a raster barcode up. Interpolation softens the bar edges and the scanner starts guessing. Export the SVG and let the RIP render at device resolution.
  • Keep the quiet zone. EAN and UPC need a blank margin of at least ten narrow-bar widths on the left and right. Designers crop this constantly, and it is the single most common cause of a “barcode that stopped working”.
  • Bars must be dark, background light. Laser scanners read in red light around 660 nm, so red, orange and pink bars are effectively invisible to them. Black on white, or a very dark blue-black, is the only safe choice.
  • Print bars parallel to the direction of paper feed on thermal printers. Bars perpendicular to the print head suffer from dot-placement error and blur.
  • Leave the human-readable text on for retail codes. When the scan fails, a cashier keys the number.

Getting real retail numbers

You can print any of these symbologies here, but a barcode you invent is only valid inside your own systems. Retail EAN-13 and UPC-A numbers encode a GS1 company prefix that is licensed to a specific business, and retailers verify it before stocking a product. Buying a “cheap barcode” from a reseller usually means renting a number from a prefix issued in the 1990s, which many large retailers now reject. If you are selling through shops, register with GS1 in your country.

ISBN-13 is a special case: your national ISBN agency issues the number, and it is simply encoded as EAN-13 with the 978 or 979 prefix already built in.

Everything runs on your device

The symbol is encoded and drawn in this tab with no server involved, so product codes, internal asset numbers and patient identifiers never leave your machine. The SVG export is plain vector paths you can drop into Illustrator, InDesign or a label template, and the PNG is a straight canvas render at whatever multiple of the on-screen size you choose.

Questions

Which symbology should I use?

Code 128 for anything internal — it takes all of ASCII and produces the shortest symbol. EAN-13 or UPC-A only if you have a real GS1 company prefix, because retail scanners look the number up in a global database. ITF-14 for outer cases, Codabar for blood banks and libraries, Pharmacode for medicine cartons.

Does it calculate check digits?

Yes. Enter 12 digits for EAN-13, 11 for UPC-A, 7 for EAN-8 or 13 for ITF-14 and the modulo-10 check digit is appended for you. If you paste the full number instead, the tool verifies the check digit and tells you the correct one when it is wrong.

Can I sell products with a barcode I made here?

You can print any symbology here, but a retail EAN or UPC number must be issued to you by GS1. Inventing one risks colliding with another company’s product, and most retailers verify the prefix before they will stock an item.

What resolution do I need for printing?

Narrow bars must survive the printer and the scanner. For retail, the narrowest bar should be at least 0.264 mm, which means exporting the SVG or using the 4× PNG at 300 dpi or more. Never scale a small PNG up in a layout program — the bar edges blur and the scan fails.

Why will my red barcode not scan?

Laser scanners read in red light, so red, orange and pink bars look the same as a white background to them. Keep the bars black or a very dark blue-black, and never print light bars on a dark background.