How to Use the Barcode Generator
- Pick a format — Choose Code 128, UPC-A, EAN-13, or Code 39 from the tabs at the top.
- Enter your data — Type your text, number, or product code. The barcode generates automatically as you type.
- Download or copy — Save your barcode as PNG or SVG, or copy it directly to your clipboard.
How to Read a Barcode
- Click the Reader button to switch to reader mode.
- Drop an image containing a barcode, or click to upload one.
- The tool will detect and decode the barcode automatically. Copy the result or open it if it's a URL.
Supported Formats
- Code 128 — The most versatile format. Encodes any ASCII text (letters, numbers, symbols). Used for shipping labels, inventory, and general-purpose barcodes.
- UPC-A — 12-digit retail barcode found on products in North America. Enter 11 digits and the check digit is calculated automatically.
- EAN-13 — 13-digit international product code used worldwide. Enter 12 digits and the check digit is calculated automatically.
- Code 39 — Alphanumeric barcode (A-Z, 0-9, and a few symbols). Common in logistics, defense, and automotive industries.
Frequently Asked Questions
What barcode formats are supported?
Four formats are supported: Code 128 (versatile, encodes any ASCII text), UPC-A (12-digit North American retail), EAN-13 (13-digit international product code), and Code 39 (alphanumeric, used in logistics and industry).
Do I need to calculate the check digit for UPC-A or EAN-13?
No. For UPC-A, enter 11 digits and the check digit is calculated automatically. For EAN-13, enter 12 digits and the tool adds the correct check digit.
What file formats can I download?
You can download as PNG (high resolution raster image) or SVG (vector format that scales to any size without quality loss), or copy the barcode image directly to your clipboard.
Can I read a barcode from an image file?
Yes. Switch to Reader mode and upload a JPEG, PNG, or WebP image containing a barcode. The tool automatically detects and decodes it, showing the result with a copy option.
Is any data sent to a server?
No. All barcode generation and reading happens 100% in your browser. No data is sent to any server.
Features
- Instant barcode generation as you type
- Download as PNG (high resolution) or SVG (vector, infinitely scalable)
- Copy barcode image to clipboard
- Auto-calculated check digits for UPC-A and EAN-13
- Input validation with helpful error messages
- Read barcodes from uploaded images (JPEG, PNG, WebP)
- 100% in-browser — no data is sent to any server
From the build: the four format encoders are hand-rolled because each one is small and the symbol tables are short. Code 128 needed the most care — it has three character subsets (A, B, C) and you have to switch between them to keep the barcode short while staying valid for the input. The check-digit logic for UPC-A and EAN-13 is the same modulo-10 weighted sum with different position weights, so it lives in one helper. We render the barcode as SVG first and rasterise to PNG via canvas on download, which means the source of truth is always vector and the PNG export can be any size without re-encoding from a low-res bitmap.