0 characters
12345

Enter valid data to generate barcode

Privacy First

Barcodes are generated entirely in your browser. Your data never leaves your device.

Barcode Types

CODE128

Most versatile. Supports all ASCII characters. Best for general use.

CODE39

Numbers, uppercase letters, and limited special characters.

EAN-13

European standard for retail products. 13 digits required.

UPC

North American standard for retail. 12 digits required.

Features

  • 4 popular barcode formats
  • Custom colors and dimensions
  • Adjustable bar width and height
  • Optional text display
  • Download as PNG or SVG
  • Real-time validation

About Barcodes

Barcodes are machine-readable representations of data using patterns of parallel lines (bars) and spaces of varying widths. First used commercially in 1974 to scan a pack of chewing gum, barcodes have become essential in retail, logistics, healthcare, and manufacturing. They enable automated data capture that is faster and more reliable than manual entry.

4 Formats
Barcode Types
PNG & SVG
Export Formats
Custom
Colors & Size
100%
Client-Side

The Complete Guide to Barcodes

What Is a Barcode?

A barcode is a visual, machine-readable representation of data. The data is encoded in the widths and spacings of parallel lines (one-dimensional or linear barcodes). When scanned by a laser or camera-based reader, the pattern of bars and spaces is decoded back into the original data — typically a number, text string, or product identifier.

The modern barcode was patented in 1952 by Norman Joseph Woodland and Bernard Silver, inspired by Morse code. However, it wasn't until 1974 that the first UPC barcode was scanned at a supermarket checkout in Troy, Ohio. Today, over 5 billion barcodes are scanned every day worldwide across retail, healthcare, transportation, and manufacturing industries.

Barcode Formats Explained

Different barcode formats (also called symbologies) are designed for different use cases. This tool supports four of the most widely used linear barcode formats:

FormatCharactersLengthPrimary Use
CODE128Full ASCII (128 chars)VariableShipping labels, logistics, general purpose
CODE390-9, A-Z, - . $ / + %VariableMilitary, automotive, government IDs
EAN-13Digits only13 digitsInternational retail products
UPC-ADigits only12 digitsNorth American retail products

How Barcodes Work

A barcode scanner emits a beam of light (laser or LED) across the barcode. The dark bars absorb light while the white spaces reflect it. A photosensitive detector inside the scanner converts these light-and-dark patterns into electrical signals, which are then decoded into the original data. Key structural elements include:

📏 Quiet Zones

Blank margins on each side of the barcode that tell the scanner where the code begins and ends. Typically 10 times the narrowest bar width.

🔲 Start/Stop Characters

Special patterns at the beginning and end that identify the barcode symbology and reading direction.

📊 Data Characters

The actual encoded information — each character is represented by a specific pattern of bars and spaces of varying widths.

✅ Check Digit

A calculated digit appended to the data for error detection. EAN-13 and UPC barcodes always include a check digit to verify scan accuracy.

When to Use Each Format

CODE128 — The All-Rounder

CODE128 is the most versatile barcode format. It supports the full ASCII character set (letters, numbers, and symbols) and produces compact barcodes. Use it for shipping labels (GS1-128), inventory management, order tracking, and any application requiring alphanumeric data. It's the default choice when no specific standard is required.

CODE39 — Simple & Self-Checking

CODE39 is one of the oldest barcode formats, widely used by the U.S. Department of Defense (MIL-STD-1189) and the automotive industry (AIAG). It supports uppercase letters, digits, and a few special characters. Its self-checking design means it doesn't require a check digit, making it simple to implement but producing wider barcodes than CODE128.

EAN-13 — International Retail Standard

EAN-13 (European Article Number) is the global standard for product identification. It encodes a 13-digit number that includes a country code, manufacturer code, product code, and check digit. Required for selling products in most countries outside North America. You need a GS1 company prefix to generate valid retail EAN-13 codes.

UPC-A — North American Retail

UPC-A (Universal Product Code) is the standard barcode for retail products in the United States and Canada. It encodes a 12-digit number. UPC-A is actually a subset of EAN-13 — any UPC-A code can be represented as an EAN-13 by prepending a zero. Like EAN-13, valid retail UPC codes require a GS1 company prefix.

Barcode vs. QR Code

FeatureBarcode (1D)QR Code (2D)
Data CapacityUp to ~25 charactersUp to 7,089 characters
Data TypesNumbers, text (limited)URLs, text, vCards, Wi-Fi, etc.
Scan DirectionHorizontal onlyAny angle (360°)
Error CorrectionCheck digit onlyReed-Solomon (7-30%)
Best ForRetail POS, inventoryMarketing, mobile apps

Need to encode more data like URLs, vCards, or Wi-Fi credentials? Try our QR Code Generator for 2D codes with higher data capacity and built-in error correction.

Best Practices for Printing Barcodes

✅ Do

  • • Use black bars on a white background for maximum contrast
  • • Maintain adequate quiet zones on both sides
  • • Print at 300 DPI or higher for best quality
  • • Test with a barcode scanner before mass printing
  • • Use SVG format for scalable, print-ready output
  • • Place barcodes on flat, non-curved surfaces

❌ Don't

  • • Use low-contrast or similar colored bars and background
  • • Print barcodes smaller than the minimum size for the symbology
  • • Truncate bar height too much (reduces scan reliability)
  • • Place barcodes on reflective or textured surfaces
  • • Stretch or compress the barcode unevenly
  • • Print over seams, folds, or perforations

Frequently Asked Questions

What barcode format should I use?
For retail products, use EAN-13 (international) or UPC-A (North America). For shipping and logistics, use CODE128. For military, government, or automotive applications, use CODE39. When in doubt, CODE128 is the safest general-purpose choice.
What is a check digit and do I need to calculate it?
A check digit is the last digit of a barcode (in EAN-13 and UPC), calculated using a mathematical formula to verify scan accuracy. If you enter 12 digits for EAN-13 or 11 digits for UPC, the check digit is calculated automatically. If you enter the full length, the check digit you provide will be used as-is.
Can I use custom colors for barcodes?
Yes, this tool supports custom foreground and background colors. However, for production use, black on white is strongly recommended. If using colors, ensure the bars are significantly darker than the background — scanners rely on high contrast between bars and spaces. Avoid red or orange bars, as many scanners use red lasers that cannot distinguish them from the background.
Should I download PNG or SVG?
Use SVG for printing — it's vector-based and scales to any size without pixelation. Use PNG for digital use (websites, apps, documents). SVG is especially important for barcodes since crisp, precise edges are critical for reliable scanning.
Is my data secure?
Yes. This barcode generator runs entirely in your browser using client-side JavaScript. No data is sent to any server. Your barcode content stays on your device, making it safe to encode product information, serial numbers, or tracking data.
What is the minimum barcode size for reliable scanning?
The minimum size depends on the symbology and scanning distance. For handheld scanners at close range, barcodes should be at least 1 inch (2.5 cm) wide. For EAN-13 and UPC retail barcodes, the GS1 standard specifies a minimum size of about 80% magnification (approximately 26.3 mm × 18.3 mm for EAN-13). Always test with your target scanning equipment.

Learn More About Barcodes

Discover the history of barcodes, how they encode data in bars and spaces, barcode symbologies like CODE128 and EAN-13, how scanners decode them, the GS1 system, and best practices for creating reliable barcodes.

Read Our Barcode Guide