Barcode Generator

Generate barcodes in multiple formats — free, instant, no signup

Code 128: Supports full ASCII (letters, numbers, symbols). Most versatile format.
2
100
#000000
#ffffff
Advertisement

About Barcode Generator

A barcode is a machine-readable representation of data using parallel lines (bars) of varying widths and spacings. Barcodes are used in virtually every industry for tracking products, managing inventory, identifying assets, and automating data entry. This free online barcode generator lets you create barcodes in four widely used formats directly in your browser. All processing happens client-side, so your data never leaves your device.

Supported Barcode Formats

Code 128 is the most versatile linear barcode symbology. It encodes the full ASCII character set (letters, numbers, and symbols) using compact, high-density bars. Code 128 is commonly used in shipping labels, logistics, and supply chain management. It supports three character sets (A, B, and C), and this tool uses Code 128 B, which covers printable ASCII characters from space (32) to tilde (126). Its efficient encoding makes it ideal for labels where space is limited but a wide range of characters is needed.

Code 39 (also called Code 3 of 9) is one of the oldest and simplest barcode formats. It encodes uppercase letters (A-Z), digits (0-9), and a handful of special characters (-, ., $, /, +, %, and space). Each character is represented by nine elements (five bars and four spaces), of which three are wide. Code 39 is self-checking, meaning a single printing defect typically does not cause a misread. It is widely used in government, military, and automotive industries.

EAN-13 (European Article Number) is the international standard for product identification in retail. It consists of exactly 13 digits: a country code, manufacturer code, product code, and a check digit calculated using the modulo-10 algorithm. EAN-13 barcodes appear on virtually every consumer product sold outside North America. If you enter fewer than 12 digits, the tool automatically pads with leading zeros and computes the check digit.

UPC-A (Universal Product Code) is the North American retail barcode standard. It is structurally similar to EAN-13 but uses 12 digits. UPC-A barcodes are found on nearly every product sold in the United States and Canada. Like EAN-13, the last digit is a check digit calculated with the modulo-10 algorithm. The tool will compute the correct check digit for you, even if you only enter 11 digits.

How Barcodes Work

A barcode scanner emits a beam of light across the bars. Dark bars absorb light while white spaces reflect it. The scanner measures the pattern of reflections to reconstruct the encoded data. The width of each bar and space conveys the binary information. Guard patterns at the start and end of the barcode help the scanner detect the beginning and orientation of the code. A check digit provides error detection, ensuring the scan is accurate.

Frequently Asked Questions

Q: Which barcode format should I choose?
If you need to encode letters and symbols, use Code 128 for maximum flexibility and compact size. For uppercase-only alphanumeric data in government or military contexts, Code 39 is the standard. For retail products, use EAN-13 (international) or UPC-A (North America). When in doubt, Code 128 is the safest general-purpose choice.

Q: Can I print the generated barcode?
Yes. Download the barcode as a PNG image for raster printing or as SVG for scalable vector output. SVG is recommended for professional printing because it can be scaled to any size without losing sharpness. For best results, use a laser printer at 300 DPI or higher and avoid scaling below the minimum bar width.

Q: What is a check digit and do I need to calculate it myself?
A check digit is an extra digit appended to the barcode data for error detection. For EAN-13 and UPC-A, this tool automatically calculates and appends the correct check digit based on the digits you enter. You do not need to calculate it manually. For Code 128, a checksum character is also computed automatically as part of the encoding process.

Q: Is my data safe when using this tool?
Absolutely. All barcode generation happens entirely in your browser using JavaScript and the HTML Canvas API. No data is sent to any server. You can verify this by disconnecting from the internet and confirming the tool still works perfectly.

Q: What is the maximum data length for each format?
Code 128 can encode up to about 48 characters in a typical label width. Code 39 is less dense, so practical limits are around 20-30 characters. EAN-13 always uses exactly 13 digits, and UPC-A always uses exactly 12 digits. Longer data simply produces a wider barcode, so the limit depends on your available print area.

Advertisement