Barcodes are all around us: on product packaging, parcels, transport tickets, and medical documents. Understanding their formats helps you generate and read codes correctly for your needs.
What is a barcode?
A barcode is a graphical representation of data using parallel lines of different widths. A reader (scanner or phone camera) analyzes the sequence of dark and light bars and decodes the encoded number or string.
There are two main types:
- Linear (1D) — one-dimensional barcodes
- Matrix (2D) — two-dimensional codes (QR, Data Matrix)
EAN-13 format
EAN-13 (European Article Number) is the most common format for consumer goods. It encodes 13 digits:
- The first 2-3 digits are the country code (460-469 for Russia)
- The next 4-5 digits are the manufacturer code
- The following digits are the product code
- The last digit is the check digit
Calculating the EAN-13 check digit
Номер: 4 6 0 1 2 3 4 5 6 7 8 9 ?
Шаг 1: умножить чётные позиции на 3
4×1 + 6×3 + 0×1 + 1×3 + 2×1 + 3×3 + 4×1 + 5×3 + 6×1 + 7×3 + 8×1 + 9×3
= 4 + 18 + 0 + 3 + 2 + 9 + 4 + 15 + 6 + 21 + 8 + 27 = 117
Шаг 2: остаток от деления на 10
117 mod 10 = 7
Шаг 3: контрольная цифра
10 - 7 = 3In total: the last digit is 3.
Code128 format
Code128 is a versatile linear barcode used for logistics and warehouse inventory management. Its advantages include:
- Encodes all 128 ASCII characters
- High data density
- Supports variable-length data
- Used on shipping documents and parcel labels
There are three code sets: A (control characters), B (lowercase letters), and C (pairs of digits). Modern scanners switch between them automatically.
Code39 format
Code39 is the oldest alphanumeric linear barcode. Its features include:
- Encodes A-Z, 0-9, and several special characters
- Easy to implement and works with older equipment
- Used in industry, the defense sector, and healthcare
- Lower density than Code128
QR code format
QR (Quick Response) is a two-dimensional matrix code. Unlike linear codes, it stores significantly more data:
| Data type | Maximum |
|---|---|
| Digits | 7 089 characters |
| Letters and digits | 4 296 characters |
| Binary data | 2 953 bytes |
| Kanji characters | 1 817 characters |
QR codes include redundancy, so data can be recovered even if 30% of the code is damaged. For more information about QR decoding, see the QR decoder guide.
Where barcodes are used
Retail: EAN-13 and EAN-8 on product packaging for checkout scanners.
Logistics and warehousing: Code128 on shipping labels, parcels, and pallets.
Industry: Code39 and Data Matrix on parts and equipment.
Medicine: barcodes on medications, samples, and patient wristbands.
Transport: QR codes in electronic tickets and boarding passes.
How to print a barcode correctly
For reliable scanning, follow these requirements:
- Resolution — at least 200 DPI; 300 DPI is recommended
- Quiet zone — blank space around the code (at least 10× the width of a bar)
- Contrast — a black code on a white background; avoid colored backgrounds
- Size — the standard size for EAN-13 is 37,29×25,93 mm
You can also use the QR generator to create and check generated barcodes.
Tool on reChecker
The barcode generator on reChecker supports EAN-13, EAN-8, Code128, Code39, and QR formats. Enter your data, select a format, and download the finished image in SVG or PNG.