Skip to main content

Barcode Generator

Generate barcodes in CODE128, EAN-13, UPC, CODE39 and more formats.

Reviewed by · Last reviewed

2
100px

How to Use the Barcode Generator

  1. Enter the data to encode - digits, letters, or both, depending on the symbology. EAN-13 and UPC-A accept only digits; CODE128 accepts the full ASCII range; CODE39 accepts uppercase letters, digits, and a small set of symbols.
  2. Choose a barcode format - select the 1D symbology that matches your use case. Retail products use EAN-13 internationally or UPC-A in North America. Warehousing and logistics generally use CODE128 or CODE39. Outer cartons use ITF-14.
  3. Adjust appearance - sliders control bar width (module width) and bar height. Toggle the human-readable text below the bars on or off, set the font size, and pick fill and background colors. For professional printing, keep the bars pure black on pure white - colored bars can confuse older scanners.
  4. Download - export as a 2x-resolution PNG for general use or SVG for vector workflows. SVG is preferred when the barcode will be scaled (packaging layouts, large signs) because it keeps module edges crisp at any size.

What 1D Barcodes Are and How This Tool Renders Them

A 1D (linear) barcode encodes characters as a sequence of alternating black bars and white spaces of varying width. A scanner reads the light-and-dark pattern horizontally and translates the width sequence back into characters via a lookup table defined by the symbology. This tool uses the JsBarcode library under the hood, which is a mature open-source JavaScript implementation that covers the major 1D symbologies. For PNG output, the library draws onto an HTML <canvas> element; for SVG, it produces an inline <svg> with one <rect> per bar. The result matches the symbology specifications exactly - you can hand the output to a Zebra printer or a commercial offset press and it will scan on any ISO/IEC 15423-compliant reader.

Barcode rendering runs entirely as client-side JavaScript. Your encoded data never leaves your browser - there is no backend call, no analytics event with your SKU or tracking number, and no external image generation service. This matters for businesses generating sensitive internal IDs: a part number or internal routing code entered here is visible only to you. Check the browser\'s DevTools Network tab to confirm zero outbound requests fire while you edit the data.

Which Symbology Fits Which Job

  • CODE128 - the workhorse for shipping labels, asset tags, and internal logistics. Encodes the full 128-character ASCII set with good information density.
  • EAN-13 - the 13-digit international retail product barcode managed by GS1. Required on any product sold through European, Asian, South American, and most African retailers.
  • UPC-A - the 12-digit North American retail barcode, also GS1-managed. Required on products sold through US and Canadian retail chains; EAN-13 is a superset (US/Canada compatible) and increasingly the default.
  • EAN-8 - a compact 8-digit variant for small products where a full EAN-13 does not physically fit (cosmetics, candy).
  • CODE39 - alphanumeric barcode historical to automotive (VIN component tags), defense, and healthcare. Lower density than CODE128 but widely scannable on older equipment.
  • ITF-14 - 14-digit numeric code used on corrugated outer cartons and shipping cases; encodes the GTIN-14 for the carton including a packaging indicator digit.
  • MSI - numeric, commonly found on warehouse shelf labels and pallet markings. Less common in retail.
  • Pharmacode - a binary numeric code (3 to 131,070) used on pharmaceutical packaging for line-inspection equipment to verify the correct insert made it into the box.

Pitfalls, Check Digits, and Print-Size Rules

EAN and UPC codes include a modulo-10 check digit that validates the preceding digits. This tool calculates the check digit automatically when you enter one fewer digit than the code requires - so enter 12 digits for EAN-13 or 11 for UPC-A and let the tool append the check. Entering all 13/12 with a wrong check digit will be rejected. For CODE128 and CODE39, most generators auto-insert start/stop characters and internal check characters (CODE128 always, CODE39 optional with the "mod 43" variant); do not include them in the input. The GS1 General Specifications define minimum physical dimensions: a standard EAN-13 must be printed at 80%-200% of nominal size (nominal = 37.29 mm x 25.93 mm); printing below 80% risks scan failure. The "X-dimension" (narrowest bar width) should be at least 0.264 mm for general retail. Bar height should be at least 15% of the code width to allow scanner beam misalignment. Include a 10X quiet zone (silent margin) of white space to the left and right - cutting into the quiet zone is the most common cause of unscannable retail labels.

GS1, Check Digits, and the 1D Barcode Ecosystem

EAN, UPC, ITF-14, and GTIN-based codes are part of the GS1 General Specifications, an international standard maintained by GS1 that assigns company prefixes so every product in the world gets a globally unique identifier. To legally use EAN-13 or UPC-A on a product sold through retailers, you must obtain a GS1 company prefix from your national GS1 office (about $30-$250 initial fee plus annual dues depending on company size). Consumer sellers sometimes buy reseller UPCs for $5-10; these technically resolve but may be rejected by major retailers, who verify prefix ownership through the GS1 GEPIR database. For internal use only - warehouse asset tracking, production-line routing, non-retail distribution - you can generate any codes you want under CODE128, CODE39, or custom numbering without GS1 involvement. Code 128 is formalized by ISO/IEC 15417; Code 39 by ISO/IEC 16388; ITF-14 and EAN/UPC by ISO/IEC 15420. All are open standards.

Comparison to BarTender, NiceLabel, and Label-Printer Firmware

Commercial label software (BarTender, NiceLabel, Zebra ZebraDesigner, Seagull Scientific) integrates barcode generation into serialized printing workflows - pull variable data from Excel, SQL, or SAP and stream labels to thermal printers at hundreds per minute. Those are the right tool for production lines and warehouses. For single-code needs, design mockups, or prototyping a new product barcode, a browser generator like this one is faster and free. Open-source command-line tools like Barcode (GNU), ZINT, and the Python barcode library produce identical output and are scriptable for automated batch generation. This tool\'s niche is immediate, on-screen generation with live customization and clean PNG/SVG export - useful for designers producing packaging comps, small businesses ordering a first production run, or anyone prototyping internal label formats. The generated SVG drops directly into Illustrator, InDesign, Affinity Designer, or Figma without format conversion. For commercial retail sale, pair the generated code with a legitimate GS1 company prefix.

Frequently Asked Questions

Which barcode format should I pick for a new retail product?

EAN-13 is the global default and the most flexible choice because it scans everywhere that UPC-A scans (North American retailers accept EAN-13 alongside UPC-A). If you are exclusively selling through US/Canadian retail, UPC-A is equivalent. Both require a GS1 company prefix before you can legally apply them to a product for sale through major retail chains. For non-retail internal use, CODE128 is a better choice because it accepts letters and has no licensing requirement.

How does the check digit work and can I get it wrong?

EAN and UPC codes end with a modulo-10 check digit computed from the preceding digits. The formula alternates weights of 1 and 3 across the digits, sums them, and takes the smallest number that brings the total to a multiple of 10. This tool calculates it automatically when you enter one digit less than the full length. If you type the wrong check digit manually, the code will be rejected - scanners on the retail side will also reject a mismatched code.

Is my barcode data sent to any server?

No. The rendering happens in browser JavaScript via the JsBarcode library and the HTML canvas/SVG APIs. Your entered data - SKU, serial, or URL - is never transmitted to a backend. You can confirm by watching the DevTools Network tab while you generate: no outbound requests fire beyond the initial static page load.

What is the difference between a PNG and SVG download?

PNG is a raster image at 2x resolution, suitable for most screen and small-format print use. SVG is vector, with each bar represented as a mathematical rectangle - it scales to any size without losing sharpness, making it the right choice for packaging design, large-format printing, and graphic design software. Professional print shops generally prefer SVG or a PDF exported from a design tool that contains the SVG. For quick labeling or a thermal printer, PNG is faster to load.

Do I need a GS1 license to use these barcodes?

For internal use (warehouse tags, asset tracking, production routing), no - you can use any numbering you want under CODE128 or CODE39. For selling products through retail chains with EAN-13, UPC-A, or ITF-14, yes. GS1 membership starts at about $30-250 initial fee plus annual dues and gives you a company prefix that guarantees your codes are globally unique. Major retailers (Amazon, Walmart, Target) verify prefix ownership in GS1's GEPIR database before accepting products.

What size should I print the barcode?

For EAN-13 and UPC-A, follow the GS1 General Specifications: nominal size is 37.29 mm wide by 25.93 mm tall, with acceptable range from 80% to 200% of nominal. The X-dimension (narrowest bar) should be at least 0.264 mm. For CODE128 and CODE39 on shipping labels, bar heights of 10-15 mm scan reliably with handheld and fixed-mount scanners at typical warehouse distances. Always include a quiet zone (white margin) of at least 10 X-dimensions on each side.

Can I use colors other than black and white?

For reliability, use black bars on a white background. Scanners detect contrast via red (625 nm) or near-infrared light; red ink on a white background is invisible to most scanners because red reflects the scanning wavelength. Safe combinations include black-on-white (ideal), dark blue or dark green on white, and black on yellow or light cream. Avoid red, orange, or light colors for bars, and never use metallic backgrounds. For design samples, any color is fine; for production, test with the actual scanner.

What is the difference between CODE128 and CODE39?

Both are alphanumeric. CODE128 is denser - it has three subsets (A, B, C) that can encode all ASCII characters with fewer bars per character, and mode C packs numeric data at 2 digits per symbol. CODE39 is older, encodes only uppercase letters, digits, and a small symbol set, and requires about 30% more space per character but is more forgiving with low-quality printing. For new internal systems, prefer CODE128. For legacy scanners or environments where print quality is uncertain, CODE39 still has a place.

Why does my scanner sometimes fail to read the barcode?

Common causes: insufficient quiet zone, printing below minimum size, low contrast, scuffed or damaged bars, reflective glare on glossy labels, or an aspect ratio that compresses the height below the minimum 15% of width. Also check that your printer is set to high DPI (300+ for thermal, 600+ for inkjet/laser) and that the barcode was rendered at or above the final physical resolution - stretching a small image to a large label destroys module edges. For critical retail applications, verify grade with an ANSI/ISO 15416 verifier.

Do I need this if I already have label-printing software?

Label software like BarTender or ZebraDesigner is better for high-volume production runs pulling variable data from a database - they handle serialization, templating, and direct printer control that a browser cannot. This tool is for ad-hoc single barcodes: a one-off product mock-up, a prototype label, a replacement for a lost asset tag, or a design sample before you commit to a full label software license. For most small businesses producing under a few hundred codes per month, a browser generator plus a thermal printer's built-in label editor is sufficient.

More QR & Barcode