Developer Tools

Free Barcode Generator

Create Code 128, Code 39, EAN-13, EAN-8, UPC-A and ITF-14 barcodes. Auto checksum, custom size and colours, and PNG or SVG download — all generated locally in your browser.

100% Offline Auto Checksum Custom Colours PNG & SVG

Content & Style

Data ASCII 32–126
Accepts letters, digits and symbols
Module width 3 px
Bar height 120 px
Bar colour
Background

Preview

Waiting for data

Type something in the left panel to see the barcode

What Is a Barcode?

A barcode is a machine-readable representation of data using parallel bars of varying widths and spacing. A scanner reads the pattern of bars and spaces, converts it to binary and decodes it back into the original value. The format has been standardised for retail, logistics and industry since the early 1970s.

This tool supports six of the most widely used barcode symbologies. Each is designed for a different use case, and picking the right one matters for compatibility.

The six formats

FormatDataUse for
Code 128Any ASCII 32–126Shipping labels, inventory, general-purpose
Code 39A–Z, 0–9, - . space $ / + %Legacy systems, ID cards, automotive
EAN-1312 or 13 digitsRetail products worldwide
EAN-87 or 8 digitsSmall retail items (gum, cigarettes)
UPC-A11 or 12 digitsRetail products in North America
ITF-1413 or 14 digitsShipping cartons and outer packaging

Check digits

EAN-13, EAN-8, UPC-A and ITF-14 all end with a check digit. It is calculated from the preceding digits using a fixed weighting (alternating ×1 and ×3), then appended. A scanner recomputes it during decode and rejects the scan if the values do not match, catching most read errors automatically.

Enter the data digits and this tool calculates the check digit for you. If you already know the full number, enter it and the tool verifies the check digit is correct — an invalid one is highlighted in red.

FormatData digits you enterTotal after check
EAN-131213
EAN-878
UPC-A1112
ITF-141314

Quiet zones

The empty margin on the left and right of a barcode is called the quiet zone. The specification requires it to be at least 10 times the width of a narrow module, so that the scanner can identify where the barcode begins and ends. Without a quiet zone, the scanner cannot reliably lock onto the pattern.

This tool includes the correct quiet zone automatically. If you crop the downloaded image or place it inside a design, keep at least 10 modules of white space on both sides.

Best practices for scannability

Common use cases

Retail Packaging

EAN-13 or UPC-A for products scanned at the till.

Shipping Cartons

ITF-14 for outer packaging and warehouse logistics.

Inventory Tracking

Code 128 on shelf labels and internal stock systems.

ID Cards & Access

Code 39 for employee badges and simple access control.

Document Tracking

Code 128 on invoices, purchase orders and files.

Pharmaceuticals

Code 128 for regulatory serial numbers and lot codes.

Event Tickets

Code 128 encoding a unique numeric ticket ID.

Lab Samples

Code 39 for specimen tubes and laboratory workflows.

Privacy and security

This barcode generator runs entirely in your browser. All encoding and rendering happens in pure JavaScript and canvas — no server, no CDN, no network requests. Nothing is uploaded, stored or logged. But remember: a barcode is not encryption. Anyone who can see the pattern can read the data.

Frequently Asked Questions

What is a barcode?
A barcode is a machine-readable representation of data using parallel lines of varying widths and spacings. A laser or camera scanner reads the pattern of bars and spaces and decodes it back into the original data. The format has been standardised for retail, logistics and industrial use since the 1970s.
Is this barcode generator free?
Yes. It is 100% free, requires no sign-up, and runs entirely in your browser. No watermarks, no expiry, no premium tier.
Is my data sent to a server?
No. All barcode encoding and rendering happens locally in your browser in pure JavaScript and canvas. Nothing is uploaded, stored or transmitted.
Which barcode format should I use?
Use Code 128 for anything general — it handles letters, digits and symbols, and is the most versatile format. Use EAN-13 for retail products sold worldwide, UPC-A for retail in North America, EAN-8 for very small retail items. Use Code 39 only when a legacy system requires it, and ITF-14 for shipping cartons and outer packaging.
What is a checksum digit?
Retail barcode formats like EAN-13, EAN-8 and UPC-A end with a check digit that is computed from the preceding digits using a fixed weighting (alternating 1 and 3). A scanner reads the entire code, recomputes the check digit and compares. If they do not match, the scan is rejected. This tool computes the check digit automatically when you enter the data digits.
What is the difference between EAN-13 and UPC-A?
UPC-A is 12 digits, used primarily in the United States and Canada. EAN-13 is 13 digits, used everywhere else and increasingly in North America too. Technically, UPC-A is EAN-13 with a leading zero — every UPC-A code is a valid EAN-13 code. This tool uses the same encoding engine for both.
How do I test that a barcode will scan?
Print the barcode at the size you intend to use it, then scan it with at least two different apps and two devices. Verify that the decoded value matches what you entered. Keep the print sharp (300 DPI or better), maintain strong contrast (black bars on white), and preserve the quiet zones on both sides — do not crop the barcode flush to its content.
What is the quiet zone?
The quiet zone is the empty margin on the left and right of the barcode. The specification requires it to be at least 10 times the width of a narrow module, so that the scanner can tell where the barcode starts and ends. This tool includes the correct quiet zone automatically. If you crop the downloaded image, keep at least 10 modules of white space on each side.
Can I use a barcode generator for retail products?
You can generate the image here, but for a real retail product you must register a unique GS1 company prefix and obtain a legitimate number from your national GS1 member organisation. Selling products with self-generated EAN-13 codes can result in rejection by retailers and legal issues with GS1.
What is the difference between PNG and SVG?
PNG is a raster format with a fixed pixel size — good for on-screen use but blurry if you scale it up. SVG is vector and scales to any size while staying perfectly sharp, making it the right choice for print, labels and anything that might be resized. For barcodes specifically, SVG is strongly preferred because blur or anti-aliasing on raster edges can prevent scanning.
Why does the barcode disappear or look wrong?
The most common causes are invalid input for the format. EAN-13 requires 12 or 13 digits, EAN-8 requires 7 or 8, UPC-A requires 11 or 12, and ITF-14 requires 13 or 14. Code 128 accepts any printable ASCII but cannot encode control characters or non-Latin scripts. This tool validates the input and shows a specific error when it cannot be encoded.

Related Developer Tools

Done!