Barcode Generator

Generate barcodes in 8 formats — style, size for print, and export as SVG or PNG, all in your browser.

Barcode settings

Use for: Retail products worldwide

Accepts: Digits only (0–9)

Length: 12 digits (check digit added) or 13 digits

Check digit: The 13th digit is a mod-10 check digit, auto-calculated from the first 12.

Which barcode format should I choose?
  • EAN-13Retail products worldwide
  • UPC-AProducts in the US and Canada
  • EAN-8Small retail packaging
  • CODE128Shipping, inventory and general purpose
  • CODE39Industrial and asset labels
  • ITF-14Cartons and logistics (shipping containers)
  • MSIInventory and warehouse shelf marking
  • PharmacodePharmaceutical packaging control

Valid value· 13/13 digits

Samples:

Check digit valid. Final barcode value: 5901234123457.

Preview

EAN-13

Encoded value: 5901234123457

Previews scale to your screen — use SVG or a high-DPI PNG for print.

Export

Saves as barcode-ean13.svg / barcode-ean13.png

SVG is recommended for print — it stays sharp at any size. Use Print to save as PDF from your browser.

Examples

EAN-13 product barcode

Enter 12 digits (check digit auto-computed) or all 13 digits, select EAN13, and download the SVG to include on a product label. EAN-13 is the standard format used on most retail products worldwide.

CODE128 internal label

CODE128 encodes any printable ASCII character, making it ideal for internal part numbers, shipping labels, or any alphanumeric identifier. Enter your value, adjust height to 60px for a compact label, and export as PNG.

Details

This tool generates standard 1-D barcodes entirely in your browser — no data is sent to a server. Choose from eight widely-used formats, enter a value, tweak line width and height, and toggle the human-readable text below the bars. When the value is invalid for the chosen format (wrong character set or digit count) the error is shown instantly. Download the result as a lossless SVG or a rasterised PNG for print or web use.

Examples

Auto-compute the EAN-13 check digit from 12 data digits

Input
format: EAN13
value: 590123412345
Output
Encoded value: 5901234123457

Entering 12 digits triggers the GTIN mod-10 check: alternating weights of 3 and 1 applied to the data digits give a check digit of 7, producing the final 13-digit barcode 5901234123457.

Detect a wrong EAN-13 check digit

Input
format: EAN13
value: 5901234123450
Output
Check digit should be 7, but you entered 0. Correct value: 5901234123457

When a full 13-digit value is entered, the trailing digit is verified against the recomputed check digit; a 'Fix check digit' button rewrites the input to the correct value in one click.

Validate a CODE128 alphanumeric value

Input
format: CODE128
value: ABC-12345
Output
Valid value

CODE128 accepts any printable ASCII character and any length; the format-specific sample list includes identifiers such as ABC-12345 for internal parts.

About this tool

The Barcode Generator creates standard 1-D barcodes for products, logistics, pharmaceuticals, and internal labels — all inside your browser with no data ever leaving your device. Enter a value, pick from eight widely-used formats, and the barcode renders immediately.

Each format enforces its own character set and length rules. The tool validates your input before rendering and surfaces a clear error when the value is incompatible — for example EAN-13 requires 12–13 digits, while CODE39 permits only uppercase letters, digits, and a few symbols.

When the barcode looks right, export it as a lossless SVG for scalable print use or as a 2× PNG for web and documents. Controls for line width, bar height, and human-readable text let you match any label specification.

How to use

  1. Generate a CODE128 barcode

    Select CODE128, type any text value, and adjust the line width and height sliders. The barcode updates live; click Download SVG or PNG to save.

  2. Create an EAN-13 product barcode

    Select EAN-13 and enter 12 digits (the check digit is computed automatically) or all 13. An invalid value shows an error; once valid, download for print.

  3. Export a high-resolution PNG

    Click Download PNG to render the barcode into a canvas at 2× resolution with a white background — ready for labels or documents.

Use cases

Producing a retail EAN-13 label for testing

Enter 12 or 13 digits, let the tool compute the check digit if needed, and download the SVG for placement on a mock product.

Generating an internal CODE128 inventory label

Encode a part number or SKU containing letters and dashes, resize height to 60px for a compact label, and export as PNG for printing.

Verifying a barcode from a printed sample

Type the digits under the printed bars to confirm the EAN-13 or UPC-A check digit matches, catching scanning errors before they leave the warehouse.

Building a Pharmacode for a pharma package

Enter a small integer (3–131070) and use Pharmacode to get the pharmaceutical-specific binary encoding, then export the SVG at 300 DPI for print.

Barcode format reference

FormatTypical use
CODE128Shipping labels, part numbers, any ASCII text
CODE39Automotive/military labels, uppercase alphanumeric IDs
EAN-13Retail product packaging worldwide (13 digits)
EAN-8Small product packaging (8 digits)
UPC-ANorth-American retail products (12 digits)
ITF-14Outer carton / wholesale packaging (14 digits)
PharmacodePharmaceutical packaging (number 3–131070)

Common mistakes

Mistake:Typing a 12-digit EAN-13 value without the check digit and assuming the encoded value is the 12-digit input.

Fix:EAN-13 always encodes 13 digits; entering 12 triggers automatic check-digit computation and the displayed 'Encoded value' is the 13-digit full string.

Mistake:Using lowercase letters in CODE39.

Fix:CODE39 only accepts uppercase A–Z, digits and a small set of symbols (- . $ / + % and space). Lowercase input fails validation immediately.

Mistake:Setting a quiet zone (margin) smaller than 8 px.

Fix:Small margins can cause unreliable scans. The tool warns when margin < 8 px; 10 px is the default and a safe lower bound for most scanners.

Mistake:Exporting a low-resolution PNG when print quality matters.

Fix:SVG is lossless at any size and is the recommended export for print. For PNG, raise the scale (2× or 3×) and the DPI to keep edges sharp on a 300 DPI printer.

Frequently asked questions

References & standards