Test in production without watermarks.
Works wherever you need it to.
Get 30 days of fully functional product.
Have it up and running in minutes.
Full access to our support engineering team during your product trial
By embedding structured data formats, GS1 barcodes standardize product identification and traceability across supply chains. Developers can use IronBarcode to generate GS1-128, DataMatrix, or other compliant barcodes, leveraging predefined application identifiers (AIs) and strict syntax rules.
This guide details the step-by-step process for building barcodes programmatically, including how to embed FNC1 control characters and validate checksums to meet ISO/IEC specifications. Businesses implementing GS1 standards in retail, manufacturing, or distribution workflows gain better system integration, fewer manual data errors, and faster inventory turnover.
Broken image Add from Pixabay, select from your files or drag and drop an image here.
GS1 barcodes are standardized identification systems that assign unique Global Trade Item Numbers (GTINs) to products, including the universal product code (UPC). These codes enable seamless tracking across global supply chains. GS1 barcodes automate inventory management, reduce manual errors, and improve retail, manufacturing, and distribution product traceability. Each consumer product variant receives a unique GTIN to ensure accurate tracking.
They support symbologies like GS1-128 and DataMatrix, which integrate with enterprise systems to streamline logistics and point-of-sale transactions. GS1 barcodes increase data accuracy by encoding structured data fields such as batch numbers and expiration dates. They also ensure compliance with industry regulations, making them indispensable for modern commerce infrastructure.
Below is a concise comparison table highlighting different types of GS1-supported barcodes and their typical applications.
Barcode Type
Typical Usage
Data Capacity
Key Features
EAN/UPC
Consumer product variants at retail POS
Up to 14 digits (primarily the GTIN)
Widely recognized; the most common barcode on retail items
GS1-128
Supply chain & logistics
Variable (can include batch, lot, and expiry)
Flexible format; often encodes additional product details
GS1 DataMatrix
Healthcare, electronics, high-value items
High capacity (can store GTIN plus extra fields)
Very compact; ideal for small products; excellent for traceability
GS1 QR Code
Marketing & consumer engagement
High capacity (can contain GTIN + URLs, etc.)
Can carry promotional information; easily scanned by smartphones
GS1 barcodes advance digital transformation initiatives by facilitating real-time data capture and analytics, bolstering supply chain visibility and decision-making. Their integration with innovative technologies such as the Internet of Things (IoT) and blockchain enhances security and traceability throughout the product lifecycle. This connectivity drives operational efficiencies and cost reductions and provides valuable insights into consumer behavior and market trends. It empowers businesses to innovate and maintain a competitive edge in a rapidly evolving global marketplace.
IronBarcode delivers robust tools for generating GS1-compliant barcodes, including formats such as GS1-128, DataMatrix, and QR codes. The library enforces strict validation of key qualifiers like application identifiers (AIs) and calculates checksums automatically to meet ISO/IEC requirements. Developers can integrate it into .NET applications to produce and customize barcode or QR Code images programmatically.
Structured data encodings include key qualifiers like batch numbers, expiration dates, and lot numbers. These improve accuracy in inventory and product tracking workflows. Retail, healthcare, and logistics industries use these features to reduce manual errors. They also enhance interoperability with point-of-sale and warehouse management systems. Using an online barcode generator simplifies the process of creating GS1-compliant barcodes. For the programmatic generation, IronBarcode provides the absolute best results.
This guide provides a detailed walkthrough for generating GS1-compliant barcodes (e.g., GS1-128) using the IronBarcode library in .NET. The process includes installation, barcode creation, customization, validation, and best practices.
To get started with GS1 barcode generation, install IronBarcode into your .NET project using NuGet Package Manager:
Install-Package BarCode
Install-Package BarCode
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'Install-Package BarCode
Alternatively, you can download it from the official website and manually add the reference to your project.
To generate a GS1 barcode, you must define the GTIN correctly and follow GS1 formatting standards. GS1-128 barcodes require structured data, including Application Identifiers (AIs) in parentheses. Below is the correct way to generate a GS1-128 barcode using IronBarcode:
using IronBarCode;
// Define GS1 barcode content with AI (01) for GTIN
var barcode = BarcodeWriter.CreateBarcode("(01)12345678901231", BarcodeEncoding.Code128GS1);
// Customize barcode settings
barcode.SetMargins(20);
barcode.AddAnnotationTextBelowBarcode("GS1-128 Barcode");
// Save barcode as an image
barcode.SaveAsPng("gs1_barcode.png");
using IronBarCode;
// Define GS1 barcode content with AI (01) for GTIN
var barcode = BarcodeWriter.CreateBarcode("(01)12345678901231", BarcodeEncoding.Code128GS1);
// Customize barcode settings
barcode.SetMargins(20);
barcode.AddAnnotationTextBelowBarcode("GS1-128 Barcode");
// Save barcode as an image
barcode.SaveAsPng("gs1_barcode.png");
Imports IronBarCode
' Define GS1 barcode content with AI (01) for GTIN
Private barcode = BarcodeWriter.CreateBarcode("(01)12345678901231", BarcodeEncoding.Code128GS1)
' Customize barcode settings
barcode.SetMargins(20)
barcode.AddAnnotationTextBelowBarcode("GS1-128 Barcode")
' Save barcode as an image
barcode.SaveAsPng("gs1_barcode.png")
This implementation results in a barcode compliant with GS1 standards, suitable for product packaging, warehouse management, and supply chain logistics. Always validate the GTIN and test the barcode with scanners to ensure it is scanned correctly and confirm compatibility with inventory and point-of-sale systems.
IronBarcode provides extensive customization options to modify barcode dimensions, colors, margins, and annotations, maintaining clarity and brand consistency. Using one barcode format across all systems reduces complexity, and customization improves barcode readability across different scanners and devices.
Here’s how you can customize a GS1 barcode effectively:
// Adjust barcode size for better scanning
barcode.ResizeTo(500, 250);
// Change barcode color to match branding requirements
barcode.ChangeBarCodeColor(System.Drawing.Color.DarkBlue);
// Set margins to ensure clear spacing around the barcode
barcode.SetMargins(20);
// Add annotation text below the barcode for better identification
barcode.AddAnnotationTextBelowBarcode("GS1-128 Barcode");
// Save barcode in different formats as needed
barcode.SaveAsJpeg("custom_barcode.jpg");
barcode.SaveAsPng("custom_barcode.png");
// Adjust barcode size for better scanning
barcode.ResizeTo(500, 250);
// Change barcode color to match branding requirements
barcode.ChangeBarCodeColor(System.Drawing.Color.DarkBlue);
// Set margins to ensure clear spacing around the barcode
barcode.SetMargins(20);
// Add annotation text below the barcode for better identification
barcode.AddAnnotationTextBelowBarcode("GS1-128 Barcode");
// Save barcode in different formats as needed
barcode.SaveAsJpeg("custom_barcode.jpg");
barcode.SaveAsPng("custom_barcode.png");
' Adjust barcode size for better scanning
barcode.ResizeTo(500, 250)
' Change barcode color to match branding requirements
barcode.ChangeBarCodeColor(System.Drawing.Color.DarkBlue)
' Set margins to ensure clear spacing around the barcode
barcode.SetMargins(20)
' Add annotation text below the barcode for better identification
barcode.AddAnnotationTextBelowBarcode("GS1-128 Barcode")
' Save barcode in different formats as needed
barcode.SaveAsJpeg("custom_barcode.jpg")
barcode.SaveAsPng("custom_barcode.png")
By customizing these elements, businesses optimize barcode performance for printing and scanning, achieving compliance with GS1 standards and improved operational efficiency.
After generating the barcode, it must be persisted in formats compatible with both printing and digital applications. High-resolution formats such as PNG, JPEG, and PDF are recommended to maintain scanability during resizing or physical printing. Here’s how to save the barcode in different formats:
// Save barcode as PNG for digital use
barcode.SaveAsPng("final_barcode.png");
// Save barcode as JPEG for printing
barcode.SaveAsJpeg("final_barcode.jpg");
// Save barcode as a PDF for documentation purposes
barcode.SaveAsPdf("final_barcode.pdf");
// Save barcode as PNG for digital use
barcode.SaveAsPng("final_barcode.png");
// Save barcode as JPEG for printing
barcode.SaveAsJpeg("final_barcode.jpg");
// Save barcode as a PDF for documentation purposes
barcode.SaveAsPdf("final_barcode.pdf");
' Save barcode as PNG for digital use
barcode.SaveAsPng("final_barcode.png")
' Save barcode as JPEG for printing
barcode.SaveAsJpeg("final_barcode.jpg")
' Save barcode as a PDF for documentation purposes
barcode.SaveAsPdf("final_barcode.pdf")
Post-saving, the barcode must undergo validation to verify its machine-readability across diverse scanning systems. This process confirms compliance with GS1 specifications and mitigates scanning errors in production environments. The validation routine typically involves decoding attempts using standard barcode reader libraries:
// Validate the barcode by attempting to read it
bool isValid = BarcodeReader.Read("final_barcode.png").Any();
Console.WriteLine($"Barcode is valid: {isValid}");
// Validate the barcode by attempting to read it
bool isValid = BarcodeReader.Read("final_barcode.png").Any();
Console.WriteLine($"Barcode is valid: {isValid}");
' Validate the barcode by attempting to read it
Dim isValid As Boolean = BarcodeReader.Read("final_barcode.png").Any()
Console.WriteLine($"Barcode is valid: {isValid}")
Systematic validation prevents operational disruptions caused by unscannable codes in supply chain management systems, point-of-sale interfaces, and inventory databases. It is a critical quality control measure, particularly for high-volume printing operations, where error correction costs escalate exponentially.
Generating GS1 barcodes using IronBarcode is a simple and effective way to improve product identification and streamline supply chain management. With its powerful features, businesses can create barcodes that comply with global standards, ensuring seamless tracking from production to point-of-sale and products online.
IronBarcode offers developers a free trial to explore its functionalities before committing to a purchase. Licensing starts at $749, offering a cost-effective and scalable solution for companies looking to implement barcode generation efficiently.