Tool to generate / decode EAN-8 barcodes. The EAN8 code (European Article Numbering 8) is a barcode standard used for commercial products.

Barcode EAN8 - dCode

Tag(s) : Character Encoding, Image Processing

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!

A suggestion ? a feedback ? a bug ? an idea ? *Write to dCode*!

The EAN-8 Barcode format is a subcategory of EAN barcodes from which it incorporates some characteristics. It allows coding only 8-digit numbers (from `0` to `9`) using 7-bit binary codes displayed in these two correspondence tables:

Digit | Left | 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 |

To code the first 4 digits, use the binary codes *left* and for the next 4 digits, use the binary codes *right*.

A complete EAN8 barcode starts and ends with a *normal guard zone* that is coded `101` and also contains a *central guard zone* that is coded `01010` and which separates the first 4 digits of the next 4.

__Example:__ The number `12341234` is coded in EAN-8 (0 = empty and 1 = black bar):

|| | 1 | 2 | 3 | 4 | || | 1 | 2 | 3 | 4 | || |

101 | 0011001 | 0010011 | 0111101 | 0100011 | 01010 | 1011100 | 1000010 | 1101100 | 1100110 | 101 |

The 8th digit of the EAN-8 barcode is a checksum.

The decryption of the EAN8 Code is done by binary reading of vertical bars (with black = 1 and white = 0), which can then be translated via the coding table (above).

The checksum is calculated with weights (`3` and `1`) associated with the first 7 digits of the bar code. The 8th digit (control character) is the digit $ x $ such as the total sum modulo 10 is equal to 0.

__Example:__ `1234567` has for sum $ 1\times3+2\times1+3\times3+4\times1+5\times3+6\times1+7\times3=60 $ and $ 60 + X \equiv 0 \mod 10 \iff x = 0 $ so the check digit is `0`

The EAN8 barcode has a graphical form of classic barcode, with generally 3 double bars a little longer located at the beginning, in the middle and at the end.

An EAN8 barcode is made to code only 8-digit numbers and so fits for small objects.

The binary representation of the EAN-8 (noted with `0` or `B` for black bars and `1` or `W` for white bars) has a fixed length of 67 bits. It begins and ends with `101` and never includes more than 4 consecutive identical bits.

dCode retains ownership of the "Barcode EAN8" source code. Except explicit open source licence (indicated Creative Commons / free), the "Barcode EAN8" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or the "Barcode EAN8" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Barcode EAN8" are not public, same for offline use on PC, tablet, iPhone or Android !

The copy-paste of the page "Barcode EAN8" or any of its results, is allowed as long as you cite the online source

Reminder : dCode is free to use.

barcode,ean8,ean,european,article,numbering,8,code

Source : https://www.dcode.fr/barcode-ean8

© 2022 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.

Feedback