How to use the ean-8 barcode generator
- Enter 7 digits of your product number, or all 8 digits if you already have the check digit.
- Choose a white or transparent background for the SVG output.
- Click Generate to create the EAN-8 barcode.
- Copy the SVG code or download the image for use on packaging or labels.
How the EAN-8 Check Digit Is Calculated
An EAN-8 barcode encodes exactly 8 digits: 7 data digits plus 1 check digit. The check digit ensures scanners can detect misreads. It uses a modulo 10 algorithm with alternating weights of 3 and 1.
To compute it, multiply each of the first 7 digits by its weight, sum the results, then find the smallest number that rounds the sum up to a multiple of 10.
For example, with the digits 9 6 3 8 5 0 7:
- Weights:
3 1 3 1 3 1 3 - Products: 27 + 6 + 9 + 8 + 15 + 0 + 21 = 86
- Next multiple of 10: 90
- Check digit: 90 - 86 = 4
The final encoded value is 96385074. If you supply 8 digits to this ean 8 barcode generator, it verifies the check digit rather than recalculating it.
EAN-8 Encoding Structure
The barcode pattern consists of 67 modules (narrow bars). Each module is either dark (1) or light (0). The structure is fixed:
| Section | Pattern | Width |
|---|---|---|
| Left guard | 101 | 3 modules |
| Left data (4 digits) | L-code (odd parity) | 28 modules |
| Center guard | 01010 | 5 modules |
| Right data (4 digits) | R-code | 28 modules |
| Right guard | 101 | 3 modules |
Unlike EAN-13, which uses a mix of L and G codes in the left half to encode a hidden 13th digit, EAN-8 always uses L-codes for the left four digits and R-codes for the right four. This makes the encoding simpler but limits the symbol to 8 digits total.
L-Code and R-Code Reference
Each digit from 0 to 9 maps to a unique 7-module pattern. L-codes always start with a light module (0) and end with a dark module (1), while R-codes are the exact bitwise inverse of L-codes.
| Digit | L-code (left) | R-code (right) |
|---|---|---|
| 0 | 0001101 | 1110010 |
| 1 | 0011001 | 1100110 |
| 2 | 0010011 | 1101100 |
| 3 | 0111101 | 1000010 |
| 4 | 0100011 | 1011100 |
| 5 | 0110001 | 1001110 |
| 6 | 0101111 | 1010000 |
| 7 | 0111011 | 1000100 |
| 8 | 0110111 | 1001000 |
| 9 | 0001011 | 1110100 |
When generating the SVG, each "1" becomes a dark rectangle and each "0" is left as space. A quiet zone of at least 7 modules is added on both sides so scanners can locate the barcode edges reliably.
When to Use EAN-8 Instead of EAN-13
EAN-8 was created specifically for small packages where a full 13-digit EAN-13 barcode would not fit. Common examples include chewing gum packets, small cosmetics, pencils, and tiny electronic components.
Because the number space is limited (only 10 million possible 7-digit numbers exist in total), EAN-8 numbers are not freely assigned. GS1 member organizations usually ask manufacturers to show that the packaging is too small for a standard EAN-13 symbol before they allocate one. For larger products, use the EAN-13 barcode generator instead.
Common Mistakes With EAN-8 Data
A frequent error is supplying 13 digits to an EAN-8 tool. EAN-8 accepts only 7 or 8 digits. If you have a 13-digit GTIN, you need an EAN-13 symbol, not EAN-8.
Another mistake is assuming the check digit is optional. Retail scanners will reject any EAN-8 barcode whose check digit does not match the computed value. Always let the generator calculate it, or verify your 8th digit before printing.
Finally, ensure adequate quiet zones when placing the SVG on packaging. Scanners require clear space on the left and right of the guard bars. A minimum quiet zone equal to 7 times the narrowest bar width (the X-dimension) is required by the GS1 specification.
Worked examples
| Example | Input | Result |
|---|---|---|
| 7 digits (auto check digit) | Digits (7 or 8): 9638507; Background: white | Encoded value: 96385074; Check digit: 4; Data digits: 9638507; Total modules: 67 |
| Full 8 digits | Digits (7 or 8): 55123457; Background: white | Encoded value: 55123457; Check digit: 7; Data digits: 5512345; Total modules: 67 |
| Transparent background | Digits (7 or 8): 1234567; Background: transparent | Encoded value: 12345670; Check digit: 0; Data digits: 1234567; Total modules: 67 |
FAQ
What is an EAN-8 barcode?
EAN-8 is a shortened version of the EAN-13 barcode used on small retail products. It encodes exactly 8 numeric digits: 7 data digits and 1 check digit.
Can I enter 7 digits or do I need all 8?
You can enter either 7 or 8 digits. If you enter 7, this ean 8 barcode generator calculates the check digit automatically. If you enter 8, it validates the check digit you provided.
How is the EAN-8 check digit calculated?
Multiply the 7 data digits alternately by 3 and 1, sum the products, and subtract the sum from the next highest multiple of 10. The result is the check digit.
Is the generated SVG suitable for printing?
Yes. The SVG uses vector rectangles that scale without pixelation. Ensure you print at a size where the narrowest bar (X-dimension) is at least 0.26 mm for retail scanning compliance.
What is the difference between EAN-8 and EAN-13?
EAN-13 encodes 13 digits and is used on most retail products. EAN-8 encodes only 8 digits and is reserved for items too small to fit an EAN-13 symbol. You can generate EAN-13 symbols using the EAN-13 barcode generator.
Does this tool upload my data anywhere?
No. The entire generation process happens locally in your browser. No digits or images are sent to any server.