Free Online Barcode Generator

Create high-quality 1D and 2D barcodes (Code 128, EAN, UPC, QR, Data Matrix and more), then download them as PNG or SVG for printing, labels, packaging, or design.

Barcode settings

Code 128 is a safe default for most applications.

For EAN/UPC, use digits only. The tool will validate length and checksum.

Bar width (px) for 1D codes.

Height for 1D, size for 2D (px).

Preview & download

Enter data and click “Generate barcode” to see a live preview here.

PNG is ideal for quick documents and web use. SVG is vector-based and best for professional printing or design tools like Illustrator, Figma, or Canva.

How to use the barcode generator

  1. Choose a barcode type that matches your use case (e.g., Code 128 for general use, EAN-13 for retail products, QR Code for URLs).
  2. Enter your data (numbers, text, or a URL). For EAN/UPC, use digits only.
  3. Adjust size and options such as bar width, height, margins, and whether to show human-readable text.
  4. Click Generate barcode to see a live preview.
  5. Use Download PNG or Download SVG to save the image for printing or design.

Supported barcode types and typical uses

Type Format Allowed characters Typical use
Code 128 1D linear Full ASCII (letters, digits, symbols) Logistics, internal inventory, shipping labels
Code 39 1D linear A–Z, 0–9, - . $ / + % and space Legacy industrial and military systems
EAN-13 1D linear 12–13 digits (numeric only) Retail products (Europe & worldwide)
EAN-8 1D linear 7–8 digits (numeric only) Small retail items with limited space
UPC-A 1D linear 11–12 digits (numeric only) Retail products (North America)
UPC-E 1D linear (compressed) 6–8 digits (numeric only) Small packages where UPC-A is too wide
ITF (Interleaved 2 of 5) 1D linear Even number of digits (numeric only) Carton labels, logistics, warehouse pallets
Code 93 1D linear Full ASCII via encoding High-density codes in limited space
QR Code 2D matrix Text, URLs, vCards, etc. Web links, marketing, contact info
Data Matrix 2D matrix Text and binary data Electronics, medical devices, tiny parts

Barcode validity rules and checksums

Many retail barcodes include a check digit to detect typing or scanning errors. This generator automatically computes and applies the correct checksum for EAN and UPC codes when you provide the base digits.

EAN-13 checksum formula

Given the first 12 digits \(d_1, d_2, \dots, d_{12}\):

1. Sum of digits in odd positions (1, 3, 5, ...):

\( S_{\text{odd}} = d_1 + d_3 + d_5 + d_7 + d_9 + d_{11} \)

2. Sum of digits in even positions (2, 4, 6, ...):

\( S_{\text{even}} = d_2 + d_4 + d_6 + d_8 + d_{10} + d_{12} \)

3. Compute total:

\( T = S_{\text{odd}} + 3 \times S_{\text{even}} \)

4. The check digit \(d_{13}\) is:

\( d_{13} = (10 - (T \bmod 10)) \bmod 10 \)

Best practices for printing and scanning

  • Use sufficient resolution: 300 DPI or higher for print. For vector workflows, prefer SVG.
  • Keep quiet zones: Leave a blank margin around the barcode (the tool’s margin setting) so scanners can detect start and stop patterns.
  • High contrast: Dark bars on a light, non-glossy background scan best.
  • Test with your scanner: Before mass printing, test a few samples with the actual scanners you’ll use.

Limitations and responsibility

This barcode generator is ideal for internal labels, prototypes, documents, and educational use. For retail products, you must obtain official EAN/UPC numbers from a standards body such as GS1 to ensure global uniqueness and compatibility with point-of-sale systems.

FAQ

Can I generate multiple barcodes at once?

This page focuses on single barcodes with full control over size and format. For batch generation, you can loop through your data in a script and call a barcode library (such as JsBarcode or a server-side tool) using the same parameters described here.

What is the difference between 1D and 2D barcodes?

1D barcodes (like Code 128, EAN, UPC) encode data in the widths and spacing of vertical bars and are usually read by laser scanners. 2D codes (like QR and Data Matrix) encode data in two dimensions using squares or dots and can store much more information, typically read by camera-based scanners or smartphones.

Why won’t my scanner read the barcode?

Common causes include insufficient size, low print quality, missing quiet zones, poor contrast, or using a symbology your scanner is not configured to read. Try increasing the module width/height, margins, and checking your scanner’s supported symbologies.