A barcode is a one-dimensional symbol that represents information through combinations of the widths of bars (lines) and spaces (gaps). From the JAN code on a product to a logistics management label, the characters that can be handled and the use cases differ by standard (symbology). In this article we explain the specifications of the major barcodes, together with samples generated for real.
1. The basic structure of one-dimensional codes
Most one-dimensional barcodes are made up of the following elements.
- Quiet zone: the margins on the left and right. If these are insufficient, the code cannot be read.
- Start/stop characters: indicate the start and end of reading and the direction.
- Data characters: the sequence of bars/spaces that represents the actual value.
- Check digit: a verification digit used to prevent misreads (required/optional depending on the standard).
2. Major symbologies (standards)
| Standard | Characters supported | Number of digits | Main use |
|---|---|---|---|
| EAN-13 / JAN-13 | Digits | 13 (1 of which is a CD) | Globally shared product code (JAN in Japan) |
| EAN-8 / JAN-8 | Digits | 8 (1 of which is a CD) | Short version for small products |
| UPC-A | Digits | 12 (1 of which is a CD) | North American product code |
| CODE39 | Digits, uppercase letters, symbols | Variable | Industry, logistics, automotive parts |
| CODE128 | Full ASCII | Variable | Logistics, shipping labels (basis of GS1-128) |
| ITF (ITF-14) | Digits (even number of digits) | Variable/14 | Cartons and other group packaging |
| Codabar (NW-7) | Digits, some symbols | Variable | Libraries, blood bags, courier delivery |
| MSI | Digits | Variable | Inventory management, shelf labels |
3. Seen in real samples
We generated representative standards for real. Pay attention to differences such as the density of the bars and how characters are handled.
4. How EAN/JAN works and the check digit
Japan's JAN code is the same standard as EAN-13, and the first two (or three) digits represent the country code. Japan begins with "45" or "49". This is followed by the manufacturer code and the product item code, with the final digit being the check digit.
Calculating the check digit (modulo 10 / weight 3-1)
The EAN-13 check digit is obtained with the following procedure.
- Counting from the rightmost digit, multiply the sum of the even-position digits by 3 and the sum of the odd-position digits by 1.
- Find that total.
- Subtract the remainder of the total divided by 10 from 10 (if the remainder is 0, the result is 0).
5. The difference between one-dimensional codes and two-dimensional codes (QR)
| Aspect | One-dimensional (barcode) | Two-dimensional (QR, etc.) |
|---|---|---|
| Data volume | Small (around a few dozen characters) | Large (thousands of characters) |
| Direction | Horizontal only | Readable from any direction |
| Error correction | Mainly a check digit | Recoverable with Reed-Solomon |
| Main use | Product codes, inventory | URLs, payments, tickets |
The QR code specification is explained in a separate article, "Understanding QR Code Specifications Completely".
Free Tool Create one for real with the Barcode Generator Generate various standards including CODE128, EAN/JAN, UPC and CODE39 by specifying bar width, height, color and margins, and download as PNG / SVG.Frequently Asked Questions (FAQ)
Are JAN codes and EAN-13 the same thing?
Japan's JAN code is the same standard as EAN-13. It has 13 digits, where the first two (or three) digits represent the country code; Japan begins with "45" or "49". This is followed by the manufacturer code and the product item code, with the final digit being the check digit.
What is the purpose of a check digit?
It is a verification digit used to prevent misreads. With it, typical errors such as a single-digit misread or the transposition of adjacent digits can be detected. In EAN-13 it is calculated using the modulo 10 / weight 3-1 method.
What is the difference between one-dimensional barcodes and two-dimensional codes (QR)?
One-dimensional barcodes hold little data (around a few dozen characters), are read only horizontally, and rely mainly on a check digit for error handling. Two-dimensional codes such as QR can hold thousands of characters, can be read from any direction, and can be recovered using Reed-Solomon codes.