# EAN-2

The EAN-2 is a supplement to the EAN-13 and UPC-A barcodes. It is often used on magazines and periodicals to indicate an issue number.

## Encoding

The encoding of EAN-2 characters is very similar to that of the other European Article Numbers. The only difference is that the digits are separated by 01. The EAN-2 always begins with "01011". Also, the R-Code is not used.

Digit | L-code | G-code |
---|---|---|

0 | 0001101 | 0100111 |

1 | 0011001 | 0110011 |

2 | 0010011 | 0011011 |

3 | 0111101 | 0100001 |

4 | 0100011 | 0011101 |

5 | 0110001 | 0111001 |

6 | 0101111 | 0000101 |

7 | 0111011 | 0010001 |

8 | 0110111 | 0001001 |

9 | 0001011 | 0010111 |

The structure of the barcode is based on the value of the two digit to be encoded. The two digits treated as a single two-digit number is reduced modulo 4 and used to find the parity pattern to be used. The parity pattern repeats every 4 values.

Data to encode | Parity pattern | |
---|---|---|

00 | LL | Encode as 0 from L table followed by 0 from L table |

01 | LG | Encode as 0 from L table followed by 1 from G table |

02 | GL | Encode as 0 from G table followed by 2 from L table |

03 | GG | Encode as 0 from G table followed by 3 from G table |

04 | LL | Encode as 0 from L table followed by 4 from L table |

05 | LG | Encode as 0 from L table followed by 5 from G table |

06 | GL | Encode as 0 from G table followed by 6 from L table |

07 | GG | Encode as 0 from G table followed by 7 from G table |

... | ... | |

98 | GL | Encode as 9 from G table followed by 8 from L table |

99 | GG | Encode as 9 from G table followed by 9 from G table |

Start | 5 (L) | Separator | 3 (G) |
---|---|---|---|

01011 | 0110001 | 01 | 0100001 |