Skip to content
YouNeed Tools
Free VPN

Barcode Generator

Type a number or text, pick the barcode type and download it as SVG or PNG. Check digits are calculated or checked for you, and everything is drawn right in your browser.

Barcode type
Bar width (pixels per module)
Bar height
5 901234 123457

EAN-13: 5901234123457, check digit 7. 95 modules wide plus quiet zones.

To sell in shops, the number must come from GS1: your company joins GS1 (GS1 US or GS1 UK) and gets a company prefix. Made-up or resold numbers can be rejected by retailers and marketplaces. For your own stock, use Code 128.

Print at 100% size in black on white, and keep the white margin either side: scanners need it.

How each barcode is drawn

EAN-13 is 95 narrow units (modules) wide: a start guard, six digits on the left, a centre guard, six on the right and an end guard. Each digit takes 7 modules as two bars and two spaces. The very first digit isn’t drawn as bars at all: it is hidden in the pattern of odd and even codes used for the left six digits. UPC-A is the same as an EAN-13 that starts with 0. Code 128 draws each character as 11 modules in three bars and three spaces; it has three character sets, and we switch to set C, which packs two digits into one character, whenever that makes the barcode shorter. Code 39 uses nine elements per character, three of them wide, with * at each end.

Worked example

EAN-13 check digit for 590123412345: weighting the digits 1, 3, 1, 3… from the left gives 5×1 + 9×3 + 0×1 + 1×3 + 2×1 + 3×3 + 4×1 + 1×3 + 2×1 + 3×3 + 4×1 + 5×3 = 83. The next multiple of 10 is 90, so the check digit is 7 and the full number is 5901234123457. For Code 128 text PJJ123C in set A, the start value 103 plus each character’s value times its position (48×1 + 42×2 + 42×3 + 17×4 + 18×5 + 19×6 + 35×7) is 878, and the remainder after dividing by 103 is the check symbol, 54. In Code 39 the optional mod 43 check for CODE39 is W.

GS1 numbers for retail

The bars are free to make; the number inside an EAN or UPC is not. GS1, the global standards body, gives each company a company prefix and companies build product numbers (GTINs) from it. Shops, supermarkets and online marketplaces use the number to look up who made the product, so numbers bought from resellers or made up can be refused and listings removed. If you sell through retailers, join GS1 in your country (GS1 US, GS1 UK and so on) or buy individual GTINs from GS1, then enter those numbers here. For internal labels, Code 128 needs no registration.

Printing tips

  • Print black bars on white; red bars are invisible to most laser scanners.
  • Keep the quiet zones (white margins) at least 10 modules wide; we include them in the files.
  • Test-scan a printed sample with a phone or scanner before printing thousands.

Related tools

Sources

Frequently asked questions

Which barcode type should I use?
For products sold in shops and on marketplaces, EAN-13 (worldwide) or UPC-A (US and Canada), with a number from GS1. For your own stock, shipping labels, asset tags and tickets, Code 128: it holds letters, numbers and symbols compactly. Code 39 is older and wider but still used in some industries and by older scanners.
Can I use these barcodes on products I sell?
The barcode is only as good as the number in it. Retailers and marketplaces such as Amazon check EAN and UPC numbers against the GS1 database, so you need a GS1 company prefix (or a single GTIN bought from GS1) for products sold through them. Barcodes made here from your GS1 numbers are standard and scan like any other.
How is the EAN-13 check digit worked out?
Multiply the first 12 digits alternately by 1 and 3 from the left (3, 1, 3… from the right), add them up, and take what is needed to reach the next multiple of 10. For 590123412345 the sum is 83, so the check digit is 7.
What size should I print a barcode?
For EAN-13 and UPC-A the nominal size is about 37 × 26 mm (1.47 × 1.02 in); GS1 allows 80% to 200% of that. Keep the white margins either side, print dark bars on a light background, and don’t squash the height. The 2 or 3 pixel bar width works well for printing at 300 dpi.
SVG or PNG?
SVG is vector, so it stays perfectly sharp at any size and is best for print and design software. PNG is a picture with whole-pixel bars, handy for documents, labels and web pages.

Last updated: 2026-11-26