Generate EAN Barcode in C#

EAN barcode is also known as European Article Number. There are different variations of EAN codes that contain supplement data as additional digits. This article covers how to create an EAN code programmatically in C#. Moreover, it guides you on how to append supplement digits with the EAN 13 code to make it EAN 5 barcode.

  1. C# EAN Barcode Generator - API Installation
  2. Create EAN 13 Barcode in C#
  3. Generate EAN 5 with Supplement Data in C#

C# EAN Barcode Generator - API Installation

We will use Aspose.BarCode for .NET for generating EAN 13 barcodes. It supports working with various types of barcodes. You can easily configure the API by downloading its reference DLL files from the Downloads page or use the NuGet package manager to install it with all the dependencies if any.

PM> Install-Package Aspose.BarCode

Create EAN 13 Barcode in C#

You need to follow the steps below to create EAN 13 barcode:

  1. Create an instance of BarcodeGenerator class and set the EncodeType to EAN13.
  2. Set the size in pixels.
  3. Save the generated EAN code as an image.

The following code snippet demonstrates how to create an EAN 13 barcode in C#:

Generate EAN 5 with Supplement Data in C#

The following steps show how to generate an EAN code with supplement data in C#.

  1. Initialize an object of BarcodeGenerator class and specify the EncodeType.
  2. Set the supplement space and EAN 5 supplement data.
  3. Export the output EAN barcode as any image format like JPG, PNG, BMP, etc.

The code snippet below elaborates how to generate EAN 5 code with supplement data programmatically in C#:

The screenshot below shows the output EAN 5 barcode with supplement data:

Generate EAN 5 in C#

Get a Free License

You may request a free temporary license in order to evaluate the features of the API without any limitations.

EAN 13 Barcode Library - Learning Resources

Besides generating and reading EAN 13 barcodes, you can learn more about various other features of Aspose.BarCode using the resources given below:


In this article, you have learned how to create an EAN 13 barcode programmatically in C#. Likewise, it also explains how to append supplement data as additional digits to generate EAN 5 barcode in C#. Please feel free to write to us at forum in case you need to discuss any of your queries.

See Also