How to create 1D and Linear Barcodes

When it comes to relaying information, linear barcodes are still the industry standard for a reason. They are fast, reliable, and work with almost any scanner. Moreover, because these barcodes don't require complex image processing, they are the best choice for high-speed environments like retail checkout lines and conveyor belts.

The main challenge is to pick the correct format for your specific needs. You might need the high data density of Code 128 for a shipping label, the compact size of EAN-8 for small products, or the strict formatting of an Intelligent Mail Barcode for postal services. With IronBarcode, you can confidently generate all these formats, knowing your process is efficient and reliable.

In this how-to guide, we will cover how to generate the most critical 1D formats and their everyday use cases using IronBarcode.

Get started with IronBarcode

Start using IronBarcode in your project today with a free trial.

First Step:
green arrow pointer


Create 1D and Linear Barcodes

Linear one-dimensional barcodes consist of variable-width lines and spaces that store data horizontally. In contrast, two-dimensional barcodes, such as QR codes, utilize a grid of squares to hold information in two dimensions. While two-dimensional codes can accommodate significantly more data, such as URLs or contact cards, one-dimensional barcodes are restricted to short strings of alphanumeric characters.

However, this simplicity allows one-dimensional barcodes to be scanned more quickly. It makes them universally compatible with standard laser scanners, making them the preferred choice for high-speed retail and logistics settings.

Let's explore the most supported formats and how to create them with IronBarcode, and go through common values and scenarios for when to use each type.

Code-128

Code 128 barcodes are commonly used for internal logistics and shipping labels. It supports the full 128-character ASCII range, making it highly efficient at compressing standard numbers and English text into a small space.

However, it does not natively allow Unicode or non-Latin characters without additional extensions. It does not support complex characters from languages such as Chinese or Arabic and would instead misinterpret the data, leading to incorrect output.

Code

IronBarcode makes generating Code-128 straightforward: we pass BarcodeEncoding.Code128 as the second parameter when calling the Create method, then export it as an image.

:path=/static-assets/barcode/content-code-examples/how-to/create-code-128-barcode.cs
using IronBarCode;

// Specify Code 128 Format
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode/", BarcodeEncoding.Code128);

// Add barcode value text below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save it as JPG
barcode.SaveAsJpeg("code128-sample.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

Code-128 Example Output

GSI-128

GS1-128 is an additional data format applied on top of Code 128. The main advantage of GS1-128 is that it allows data to be interpreted consistently globally, eliminating misinterpretation and data ambiguity.

However, due to its strict formatting, missing a hidden control character or getting a field length wrong will render the barcode non-compliant, making it difficult to create manually.

GSI-128 Formatting

A barcode scanner also uses AI (Application Identifier), a numeric prefix that identifies the information in the product code.

GS1-128 follows a four-part data structure as shown below:

(Numeric prefix 01) GTIN (Global Trade Item Number): The first part of the structure is the Global Trade Item Number. This is the unique ID of the product that identifies what the product is. It must be exactly 14 digits of numeric data. If the product code is shorter, you must pad the value with leading zeros. For example, if your product code is a 12-digit number such as 123456789012, you must add two zeros at the front to fulfill the requirement (e.g., 00123456789012).

(Numeric prefix 10) Batch/Lot: The numeric prefix 10 identifies the batch or lot number of the product in the GS1-128 code. The format can vary from 1 to 20 alphanumeric characters. If you place the batch number in the middle of the barcode, ensure you place FNC1 as a separator character so the scanner knows where the batch number ends and the next field begins. If the batch number is at the very end of the barcode, the separator is not required.

(Numeric prefix 17) Expiration Date: After the numeric prefix 17, the product's expiration date follows. The format is fixed at six digits. It strictly follows the YYMMDD rule; for example, 251231 would be December 31, 2025. Note that it doesn't use 4-digit years and automatically assumes the century based on a sliding window.

(Numeric prefix 21) Serial Number: After the numeric prefix 21, the product's serial number follows. It identifies the unique individual unit. The format is variable-length, with 1-20 alphanumeric characters.

Please notePlease note that only the anchor (e.g., GTIN) is always needed in the product code; the batch, expiry, and nd serial attributes are optional for the barcode.

WarningAlthough only the GTIN is required, some retailers may have their own compliance guidelines for the barcode. Please ensure to check the relevant information on their end when creating the barcode.

GSI Format Table

AI Name Data Type Length Fixed or Variable?
01 GTIN (Global Trade Item Number) Numeric 14 digits Fixed
10 Batch/Lot Number Alphanumeric 1-20 chars Variable
(Needs FNC1 delimiter if not at the end)
17 Expiration Date Numeric (Date) 6 digits
(YYMMDD)
Fixed
21 Serial Number Alphanumeric 1-20 chars Variable
(Needs FNC1 delimiter if not at the end)

Code

Generating a GS1-128 barcode is relatively easy; developers only need to pass BarcodeEncoding.Code128GS1 as the second parameter when calling Create.

The example below shows a full GS1-128-compliant value with all four attributes, and it exports it as an image afterward.

Please noteDo note that the bracket parentheses are required for each numeric prefix as shown below, or else that specific section would not be recognized as a valid attribute and be skipped when generating the final barcode.

Please noteIronBarcode automatically inserts the FNC1 separator for you when creating GSI-128.

:path=/static-assets/barcode/content-code-examples/how-to/create-gsi-128-barcode.cs
using IronBarCode;

// Valid GS1-128 String: GTIN + Expiry + Batch + Serial Number
string gs1Value = "(01)01234567890128(17)251231(10)BATCH001(21)111111";

// Create the barcode
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode(gs1Value, BarcodeEncoding.Code128GS1);

// Display the value below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save as a JPG file
barcode.SaveAsJpeg("gsi128-sample.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

GS1-128 Example Output

Troubleshooting

If your string value is not in compliance with the standards of GS1-128, IronBarcode will throw an exception when running the code. Please verify your string value by referring to the table above and modify the string value accordingly.

GS1-128 Exception

Code 39

Code 39 is one of the first available standards for alphanumeric barcodes, well known for its reliability. The most common use cases for Code 39 barcodes are in the automotive and defense sectors.

However, the set of characters allowed for Code 39 is relatively small. It only allows Uppercase English characters, digits, and some symbols such as /, ., -, etc. It does not support lowercase characters in its standard mode.

Code

To generate a Code39 barcode, we have to pass BarcodeEncoding.Code39 as the second parameter when using the Create method.

Here's an example below.

:path=/static-assets/barcode/content-code-examples/how-to/create-code-39-barcode.cs
using IronBarCode;

// Specify Code39 Format
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode("IRON-1234", BarcodeEncoding.Code39);

// Stamp barcode value below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save as a JPG file
barcode.SaveAsJpeg("code39.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

Code39 Example Output

Troubleshooting

Code39 Exception

If the string value does not conform to the Code39 standard, IronBarcode would throw this exception.

Warning Although the extended mode of Code39 supports the full ASCII character range, IronBarcode currently doesn't support generating Code39 extended-mode barcodes; only reading is supported at the moment. For reading both extended and standard Code39, please refer here
.

Code 93

Code 93 was designed as an improved version of Code 39, commonly used in logistics and electronic component labeling, where space is limited but alphanumeric data is required.

It accepts the full range of ASCII characters as well as uppercase English letters, digits, and symbols. It offers higher density than Code 39.

Code

To generate a Code 93 barcode, pass BarcodeEncoding.Code93 as the second parameter when using Create. Here's the example code for it.

:path=/static-assets/barcode/content-code-examples/how-to/create-code-93-barcode.cs
using IronBarCode;

// Valid Input: Uppercase A-Z, 0-9, specific symbols
string code93Value = "ELEC-COMP-99";

// Create Code 93
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode(code93Value, BarcodeWriterEncoding.Code93);

// Stamp barcode value below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save as a JPG file
barcode.SaveAsJpeg("code93.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

Code93 Example Output

CodaBar

Codabar is commonly found in scenarios where poor print quality is expected, as it is quite robust. As such, it is widely used in scenarios such as blood banks and libraries.

The Codabar barcode format is variable-length, but it supports a limited character set. It can only contain digits (0-9) and symbols such as (-, $, :, /, ., +). You can also use the start and stop characters A, B, C, and D to indicate when it starts or ends. However, you cannot put those characters in the middle portion; they are only allowed at the start or the end.

Code

To generate a Codabar barcode, pass BarcodeEncoding.Codabar as the second parameter when using Create. Here's the example code for it.

:path=/static-assets/barcode/content-code-examples/how-to/create-codabar-barcode.cs
using IronBarCode;

// Valid Input: Numbers 0-9 and symbols -$:/.+ IronBarcode automatically appends by A, B, C, or D
string codabarValue = "10500200";

// Create Codabar
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode(codabarValue, BarcodeWriterEncoding.Codabar);

// Stamp barcode value below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save as a JPG file
barcode.SaveAsJpeg("codabar.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

Codabar Example Output

Troubleshooting

If the input value contains letters, IronBarcode would throw an exception stating that it only accepts numeric values.

Codabar Exception

DataBar

GS1 DataBar (formerly RSS-14) is a standard, more compact version designed to hold the product identification number.

Similar to the GS1-128 variant, it has a strict encoding format that developers must adhere to. The Omnidirectional variant contains only the product code attribute.

GS1-DataBar Format

(Numeric prefix-01) GTIN (Global Trade Item Number) : The first and only part of the structure is the Global Trade Item Number. This is the unique ID of the product. It must be exactly 14 digits of numeric data.

WarningThe standard "GS1 DataBar Omnidirectional" can only hold the GTIN (01). To include the extra parts below, you must use GS1 DataBar Expanded.

Code

To generate a GS1 DataBar barcode, pass BarcodeEncoding.DataBar as the second parameter when using Create. Here's the example code for it.

:path=/static-assets/barcode/content-code-examples/how-to/create-gs1-databar-barcode.cs
using IronBarCode;

// Valid Input: Exactly 14 digits (GTIN). IronBarcode will calculate and append the correct check digit.
string databarValue = "0123456789012";

// Create GS1 DataBar
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode(databarValue, BarcodeWriterEncoding.DataBar);

// Stamp barcode value below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save as a JPG file
barcode.SaveAsJpeg("databar.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

GS1-Databar Example Output

EAN-13

EAN-13 is the standard retail barcode used worldwide to identify consumer products—one of the most widely used barcode formats.

However, the EAN-13 is usually obtained through strict licensing. You cannot simply generate an EAN-13 number for public use; you must license a GS1 Company Prefix to make sure your barcodes are unique. It also follows that it can contain only 13 numeric digits and is numerical.

Additionally, EAN-13 also has its specific set of formatting rules.

EAN-13 Formatting

An EAN-13 barcode consists of four parts, as shown below.

GS1 Prefix (First 3 Digits): Identifies the GS1 Member Organization, typically the country where the manufacturer is registered. For example, 000-019 (USA/Canada - compatible with UPC), 500-509 (UK), 450-459 (Japan).

Manufacturer Code: A variable-length code assigned to the company by GS1.

Product Code: Assigned by the manufacturer to the specific item.

Check Digit (Last Digit): A single digit calculated from the first 12 using a Modulo 10 algorithm. It ensures the scanner reads the barcode correctly.

WarningPrefixes starting with 2 (specifically 200-299) are reserved for restricted circulation numbers. As such, in a production setting, do not use those prefixes when generating an EAN-13 barcode.

Code

To generate an EAN-13 barcode, pass BarcodeEncoding.EAN13 as the second parameter when using Create. Here's the example code for it.

:path=/static-assets/barcode/content-code-examples/how-to/create-ean13-barcode.cs
using IronBarCode;

// Valid Input: 12 digits (library calculates 13th check digit) or full 13 digits.
string ean13Value = "4006381333931";

// Create EAN-13
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode(ean13Value, BarcodeWriterEncoding.EAN13);

// Stamp barcode value below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save as a JPG file
barcode.SaveAsJpeg("ean13.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

EAN-13 Example Output

Troubleshooting

IronBarcode would throw an exception for numeric values only if there are other characters.

EAN-13 Troubleshooting

EAN-8

EAN-8 is the condensed version of the standard EAN-13 retail barcode. The main use case is for small consumer products where a full-size barcode would take up too much space. Items like pencils and cosmetics are typically where you would find EAN-8 barcodes.

Unlike Code 128 or Code 39, EAN-8 generally has a specific prefix assigned rather than developers assigning a number arbitrarily.

As such, EAN-8 uses a strict 8-digit format. It has 7 data digits and exactly one check digit, and it is numeric only.

Code

Creating an EAN-8 code is simply passing the BarcodeEncoding.EAN8 value to the second parameter when using Create. Here's an example shown below.

:path=/static-assets/barcode/content-code-examples/how-to/create-ean8-barcode.cs
using IronBarCode;

// Valid Input: 7 digits (library calculates 8th check digit).
string ean8Value = "1234567";

// Create EAN-8
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode(ean8Value, BarcodeWriterEncoding.EAN8);

// Stamp barcode value below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save as a JPG file
barcode.SaveAsJpeg("ean8.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

EAN-8 Example Output

Troubleshooting

If the input value contains 8 or more numeric characters, IronBarcode would throw an exception stating that the EAN-8 length requirement is 8 characters.

EAN-8 Exception

Intelligent Mail (IMB)

The Intelligent Mail Barcode (IMB) is the USPS standard for automating mail sorting and tracking. Unlike traditional barcodes, which vary in bar width, the IMB uses height-modulated bars to encode data. It is mandatory to claim automation price discounts on letters and flats. The IMB barcode supports only a specific set of numeric lengths; the value must be 20, 25, 29, or 31 digits.

Furthermore, it employs a specific set of numeric prefixes to define information, as shown below.

Intelligent Mail Formatting

(First 2 Digits) Barcode ID: The first part of the structure is the Barcode Identifier. This is strictly numeric data with 2 digits. For most standard commercial mail, this value is 00.

(Next 3 Digits) Service Type ID (STID): The next 3 digits define the class of mail (e.g., First Class, Marketing Mail) and the services you are requesting (e.g., Address Correction, Tracking). This is critical for postal discounts.

(Next 6 or 9 Digits) Mailer ID (MID): After the STID, the Mailer ID follows. This is a 6- or 9-digit number assigned directly to your company by the USPS.

(Next 6 or 9 Digits) Serial Number: After the Mailer ID comes the Serial Number. This identifies the unique individual mailpiece.

(Last 0, 5, 9, or 11 Digits) Routing Code: The final part of the structure is the Routing Code, which is simply the delivery ZIP code.

Code

To generate an IMB barcode, we pass BarcodeEncoding.IntelligentMail as the second parameter when we call the Create method. Here's an example showcasing it.

:path=/static-assets/barcode/content-code-examples/how-to/create-imb-barcode.cs
using IronBarCode;

// Valid Input: 20, 25, 29, or 31 digits. 
// Format: Barcode ID(2) + Service(3) + Mailer ID(6/9) + Serial(9/6) + Routing Zip(0/5/9/11)
string imbValue = "00270123456200800001";

// Create Intelligent Mail
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode(imbValue, BarcodeWriterEncoding.IntelligentMail);

// Stamp barcode value below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save as a JPG file
barcode.SaveAsJpeg("imb.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

Intelligent Mail Example Output

Troubleshooting

IronBarcode would throw an exception stating that the format is incorrect if it is not followed. Please verify the string value from the format above and retry it after modification.

Intelligent Mail Exception

Modified Plessey (MSI)

MSI is a barcode commonly used on retail shelf tags and in warehouse inventory control, but it is seldom found on consumer products.

MSI is a numeric-only barcode; as such, no letters or symbols are allowed. It varies in length, but the standard is around 10-15 digits.

Code

To generate an MSI barcode, we pass BarcodeEncoding.MSI as the second parameter when we call the Create method. Here's an example showcasing it.

:path=/static-assets/barcode/content-code-examples/how-to/create-msi-barcode.cs
using IronBarCode;

// Valid Input: Numeric digits only. Variable length.
string msiValue = "1234567890";

// Create MSI
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode(msiValue, BarcodeWriterEncoding.MSI);

// Stamp barcode value below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save as a JPG file
barcode.SaveAsJpeg("msi.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

MSI Example Output

UPC-A

UPC-A is the standard retail barcode used in the United States and Canada. It is a 12-digit subset of the EAN-13 standard. They are most commonly found on products sold in North American supermarkets.

Similar to EAN-13, it is typically assigned rather than generated.

UPC-A contains exactly 12 numeric digits and doesn't accept any letters.

UPC-A Formatting

Number System Character (1): Identifies product type (0, 1, 6, 7, 8 usually for standard retail; 2 for random weight, 3 for drugs, 5 for coupons).

Manufacturer Code (5): Assigned by GS1.

Product Code (5): Assigned by the manufacturer.

Check Digit (1): Calculated modulo 10 checksum.

Code

To generate a UPC-A barcode, we pass the BarcodeEncoding.UPCA as the second parameter when we call the Create method. Here's an example showcasing it.

:path=/static-assets/barcode/content-code-examples/how-to/create-upc-a-barcode.cs
using IronBarCode;

// Valid Input: 11 digits (library calculates 12th check digit) or full 12 digits.
string upcaValue = "01234567890";

// Create UPC-A
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode(upcaValue, BarcodeWriterEncoding.UPCA);

// Stamp barcode value below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save as a JPG 
barcode.SaveAsJpeg("upca.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

UPC-A Example Output

Troubleshooting

As you can see, IronBarcode throws an error if the provided numeric value exceeds 13 in length.

UPC-A Exception class=

UPC-E

UPC-E is the compact version of the standard UPC-A barcode. It is explicitly designed for small retail packaging, such as soda cans, where a full 12-digit UPC-A barcode would be too large to scan.

Like the UPC-A formatting, it is strictly numeric and does not accept letters and symbols.

Code

To generate a UPC-E barcode, we pass BarcodeEncoding.UPCE as the second parameter when we call the Create method. Here's an example showcasing it.

:path=/static-assets/barcode/content-code-examples/how-to/create-upc-e-barcode.cs
using IronBarCode;

// Valid Input:8 digits or less, which the last digit is a check digit calculated from the first 7 digits. 
// IronBarcode automatically calculates the check digit if only 7 digits are provided.
string upceValue = "0123456";

// Create UPC-E
GeneratedBarcode barcode = BarcodeWriter.CreateBarcode(upceValue, BarcodeWriterEncoding.UPCE);

// Stamp barcode value below the barcode
barcode.AddBarcodeValueTextBelowBarcode();

// Save as a JPG file
barcode.SaveAsJpeg("upce.jpg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

UPC-E Example Output

Troubleshooting

As you can see IronBarcode throws an error if the numeric digit provided is more than 8.

UPC-E Troubleshooting

Overview of Different 1D Barcode Types

Name Format Common Usage Restrictions & Pitfalls
Code 128 Alphanumeric
Full ASCII 128 supported. Variable length. High density.
Internal logistics, shipping labels, asset tracking, ID cards.
  • No Unicode: Cannot natively encode special characters (like Chinese or Emojis) without breaking scanner compatibility.
  • Printer Quality: Requires high resolution; low-DPI thermal printing can cause readability issues.
GS1-128 Structured Alphanumeric
Code 128 with leading FNC1 + Application Identifiers (e.g., (01)).
Global supply chain (Walmart/Amazon), pallet labels, EDI.
  • Missing FNC1: Must start with the invisible FNC1 character or scanners read it as raw text.
  • Parentheses: Do not encode the () around AIs; they are for human readability only.
Code 39 Alphanumeric (Restricted)
Uppercase A-Z, 0-9, and -. $ / + % space.
Automotive (AIAG), Defense (LOGMARS), legacy industrial IDs.
  • No Lowercase: Standard mode fails if you input "a". Extended mode supports it but requires specific scanner config.
  • Low Density: Produces very wide barcodes, not suitable for small labels.
Code 93 Alphanumeric
Similar to Code 39 but with a higher density.
Electronics (PCBs), Canada Post, and internal manufacturing.
  • Check Digits: Requires two mandatory check digits (C and K). Do not calculate these manually; let the library do it.
  • Scanner Support: Often disabled by default on scanners to prevent conflicts with Code 39.
Codabar Numeric + Symbols
0-9 and - $ : /. +. Start/Stop: A, B, C, D.
Blood banks, Libraries, FedEx Airbills (Legacy).
  • Short Reads: Prone to errors where a scanner reads a partial code (e.g., reading "123" from "12345").
  • No Letters: Cannot encode data letters, only A-D as delimiters.
GS1 DataBar Numeric (14 Digits)
Encodes GTIN-14 only. Extremely compact.
Loose produce (fruit stickers), small cosmetics, and healthcare vials.
  • No Attributes: The standard Omnidirectional version cannot hold Expiry or Batch data (requires Expanded version).
  • Strict Input: Must be exactly 14 digits.
EAN-13 Numeric (13 Digits)
Country + Mfg + Product + Check Digit.
Global Retail Point-of-Sale (Supermarkets).
  • Licensing: Requires a paid GS1 Company Prefix.
  • Restricted Prefixes: Prefixes 200-299 are for in-store use only and will not work in the global supply chain.
EAN-8 Numeric (8 Digits)
7 Data + 1 Check Digit.
Tiny retail packages (chewing gum, pencils).
  • Availability: Hard to obtain; GS1 only issues these if your product is physically too small for EAN-13.
  • Input Length: Must be exactly 7 or 8 digits.
Intelligent Mail Numeric (20, 25, 29, 31 Digits)
Height-modulated (4-state) bars.
USPS Mail Sorting & Automation.
  • Strict Lengths: Input must match exact USPS fields (Barcode ID, STID, MID, Serial, Zip).
  • STID "234": Do not use this example ID in production; it may lead to rejected mail or lost discounts.
MSI (Plessey) Numeric Only
Variable length.
Retail shelf tags, warehouse bins.
  • Checksum Confusion: Supports Mod 10, Mod 11, Mod 1010, etc. You must know exactly which one your scanner expects.
  • Reliability: Poor read rate compared to modern codes.
UPC-A Numeric (12 Digits)
11 Data + 1 Check Digit.
North American Retail Point-of-Sale.
  • Region: Primarily US/Canada. Global sellers should use EAN-13.
  • Leading Zeros: Technically, an EAN-13 starting with 0.
UPC-E Numeric (6 Digits)
Compressed format.
Small retail packaging (Soda cans) in the US/Canada.
  • Compression Rules: You cannot just "convert" any UPC-A. Your number must have a specific pattern of zeros to be compressible.
  • Number System: Only supports Number System 0 or 1.

Frequently Asked Questions

What is a 1D barcode?

A 1D barcode, also known as a linear barcode, is a series of parallel lines and spaces of varying widths that encode information. They are commonly used in retail and logistics.

How can I generate 1D barcodes using C#?

You can generate 1D barcodes in C# using IronBarcode, which provides a simple API to create various types of one-dimensional barcodes for your applications.

Which types of 1D barcodes can I create with IronBarcode?

With IronBarcode, you can create several types of 1D barcodes, including Code 39, Code 128, EAN, UPC, and more.

Is it possible to customize the appearance of 1D barcodes in IronBarcode?

Yes, IronBarcode allows you to customize the appearance of 1D barcodes, including their colors, sizes, and text fonts.

Can IronBarcode encode additional information in a 1D barcode?

Yes, IronBarcode can encode additional information such as product details or serial numbers into a 1D barcode, depending on the barcode type.

What are the advantages of using 1D barcodes?

1D barcodes are simple and cost-effective, making them ideal for applications in retail, inventory management, and logistics. They allow for quick and accurate data entry.

Can I read 1D barcodes with IronBarcode?

Yes, IronBarcode can be used to read and decode 1D barcodes from images or scanned documents.

How do I integrate IronBarcode into my C# project?

To integrate IronBarcode into your C# project, you can easily install it via NuGet Package Manager and reference it in your project files.

Is IronBarcode suitable for commercial use?

Yes, IronBarcode is designed for commercial use, providing robust features and support for developers creating enterprise-level applications.

What resources are available for learning how to use IronBarcode?

IronBarcode provides extensive documentation, tutorials, and code examples on their website to help developers learn how to use the library effectively.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Nuget Downloads 1,964,769 | Version: 2025.11 just released