Barcode Generator

Generate crisp vector SVG and high-resolution PNG barcodes in Code 128, EAN-13, UPC-A, and Code 39 with automatic check-digit calculation.

Barcode Configuration

Symbology / Format
Examples:
Bar Width (Module px)
2
Barcode Height (px)
80
Show Human-Readable Text

Live Barcode Preview

SKU-2026-884

Encoding Details

Format
Code 128
Normalized Code
SKU-2026-884
Check Digit
50
0.0/ 5
0 ratings
Rate this tool
Click stars to rate

Comments

U

Generate Print-Ready Vector and Raster Barcodes in Seconds

Whether you are preparing retail packaging for a supermarket launch, printing warehouse bin labels, or tagging IT assets, generating a compliant barcode should not require installing desktop label software or risking your product codes on third-party servers. The interactive Barcode Generator above encodes your text or numeric identifiers locally in your browser and outputs crisp, scannable SVG vector graphics and high-resolution PNG images in real time.

Simply pick your barcode symbology (Code 128, EAN-13, UPC-A, or Code 39), type or select an example value, and fine-tune bar width, height, and colors. If you are working with retail codes, you can enter just the first 12 digits for EAN-13 or 11 digits for UPC-A and let the tool compute and append the mandatory check digit automatically.

Which Barcode Format Should You Choose?

Selecting the right symbology depends on where the barcode will be scanned and what characters your identifier contains. Use the comparison table below to match your use case to the right standard.

Barcode FormatAllowed CharactersTypical LengthCheck DigitBest For
Code 128Full printable ASCII (letters, digits, symbols)VariableAutomatic (Mod 103)Shipping labels, warehouse SKUs, logistics
EAN-13Numeric digits (0–9)13 digits (enter 12 or 13)Mandatory (Mod 10)Global retail products, POS checkout
UPC-ANumeric digits (0–9)12 digits (enter 11 or 12)Mandatory (Mod 10)North American retail, grocery & consumer goods
Code 39Uppercase A–Z, 0–9, space, - . $ / + %VariableOptionalAsset tags, automotive, defense & healthcare

Print Quality Checklist: Quiet Zones, Contrast, and File Formats

Even a mathematically valid barcode will fail at the checkout counter or warehouse dock if it is printed with insufficient margins or low-contrast colors. Follow these physical printing rules to guarantee first-pass scan reliability.

Preserve the Quiet Zone

Every linear barcode requires blank space—known as the quiet zone—to the left of the first bar and to the right of the last bar. Scanners use this blank margin to detect where the symbol begins and ends. Our generator automatically includes a 10-module quiet zone on both sides of the SVG and PNG output, so avoid cropping tightly around the outer bars when placing the graphic into a label layout.

Maintain High Bar-to-Background Contrast

Optical and laser barcode scanners read reflected light. Dark bars (such as pure black #000000 or deep navy #111827) on a bright, matte light background (#ffffff) yield the highest contrast ratio. Avoid red or warm orange bars, because standard 650 nm red laser scanners cannot distinguish red ink from a white background.

SVG Vector vs. PNG Raster Export

  • Download SVG when importing into vector design tools (Adobe Illustrator, Figma, Inkscape) or high-DPI commercial packaging workflows. SVG rectangles remain razor-sharp at any physical scale without anti-aliasing blur.
  • Download PNG when embedding directly into spreadsheets, web dashboards, or thermal label printers that accept raster images. The tool renders PNG exports at 2x resolution onto an offscreen canvas so bar edges stay crisp.

Real-World Walkthrough: Preparing a Retail EAN-13 Label

Imagine you are launching a new specialty coffee bag and your GS1 company prefix plus item reference gives you the 12-digit base number 590123412345. Before sending artwork to the print house, you need the complete 13-digit EAN-13 code and a vector graphic.

  1. Switch the format tab to EAN-13 and enter 590123412345 into the Barcode Data field.
  2. The encoder immediately computes the Modulo-10 check digit (7) and displays the normalized 13-digit code 5901234123457 in the Encoding Details panel.
  3. Keep Bar Width at 2 px and Barcode Height at 80 px with Show Human-Readable Text enabled so cashiers can key in the number manually if a label is damaged.
  4. Click Download SVG (or Copy SVG) and drop the vector file directly onto your packaging dieline.

If a colleague later types 5901234123450 by mistake, the real-time validator catches the mismatch and alerts you that the expected check digit is 7 rather than 0, preventing costly misprinted packaging runs.

Under the Hood: Check-Digit Math and Bar Encoding

Retail standards like EAN-13 and UPC-A rely on a weighted Modulo-10 checksum to catch single-digit typos and adjacent-digit transpositions during manual entry.

For an EAN-13 code with digits d1,d2,…,d12d_1, d_2, \dots, d_{12} (from left to right), odd positions carry weight 1 and even positions carry weight 3. The check digit d13d_{13} is computed as:

SEAN=∑i=112wi⋅di,wi={1if i is odd3if i is evenS_{\text{EAN}} = \sum_{i=1}^{12} w_i \cdot d_i, \quad w_i = \begin{cases} 1 & \text{if } i \text{ is odd} \\ 3 & \text{if } i \text{ is even} \end{cases} d13=(10−(SEAN mod 10)) mod 10d_{13} = (10 - (S_{\text{EAN}} \bmod 10)) \bmod 10

UPC-A uses the exact same principle across its 11 payload digits, with weights alternating 3 for odd positions and 1 for even positions—which is mathematically identical to prefixing an EAN-13 code with a leading zero. Meanwhile, Code 128 (standardized under ISO/IEC 15417) appends a position-weighted Modulo-103 check symbol before the 13-module Stop pattern, while Code 39 frames every payload with * start and stop delimiters using a 3:1 wide-to-narrow bar ratio.

Frequently Asked Questions (FAQ)