How to create 1D and Linear Barcodes

IronBarcode enables you to generate all major 1D barcode formats including Code 128, GS1-128, Code 39, Code 93, EAN-13, EAN-8, UPC-A, UPC-E, Intelligent Mail, MSI, Codabar, and DataBar using simple C# code with automatic validation and compliance checking. You can explore the complete list of supported barcode formats to find the right one for your needs.

Linear barcodes remain the industry standard for relaying information. They are fast, reliable, and work with almost any scanner. Since these barcodes don't require complex image processing, they excel in high-speed environments like retail checkout lines and conveyor belts.

The main challenge is selecting the correct format for your specific needs. You might need Code128’s high data density for shipping labels, EAN8’s compact size for small products, or IntelligentMail Barcode’s strict formatting for postal services. IronBarcode helps you generate all these formats efficiently and reliably. The library also supports various output data formats to integrate seamlessly with your existing systems.

This guide covers how to generate the most critical 1D formats and their common use cases with IronBarcode.

Get started with IronBarcode


Quickstart: Create Your First 1D Barcode

  1. Install IronBarcode via NuGet Package Manager
  2. Use BarcodeWriter.CreateBarcode() with your data string
  3. Specify the barcode type with BarcodeEncoding enum
  4. Save as JPEG, PNG, or PDF using SaveAs methods
  5. Apply optional styling with font size and margins

Here's a complete example:

```cs :title=Quickstart using IronBarCode;

// Create a simple Code128 barcode GeneratedBarcode barcode = BarcodeWriter.CreateBarcode("HELLO-WORLD-123", BarcodeEncoding.Code128);

// Save the barcode as an image barcode.SaveAsJpeg("MyFirstBarcode.jpg");

// Or save with custom dimensions barcode.ResizeTo(400, 100); barcode.SaveAsPng("MyCustomBarcode.png");


For more detailed installation instructions, visit our [Get Started Overview](https://ironsoftware.com/csharp/barcode/docs/) page.

<!-- TODO: Add image here -->
<!-- ![Output showing create 1d and linear barcodes results in IronPDF](/static-assets/images/TODO/create-1d-and-linear-barcodes-code_output.webp) -->
<!-- Description: Screenshot showing code execution output or results -->

## How Do I Create 1D and Linear Barcodes?

Linear one-dimensional barcodes use variable-width lines and spaces to store data horizontally. Two-dimensional barcodes like QR codes use a grid of squares to hold information in two dimensions. While two-dimensional codes accommodate more data, such as URLs or contact cards, one-dimensional barcodes are restricted to short alphanumeric strings. 

This simplicity allows one-dimensional barcodes to scan more quickly. It makes them universally compatible with standard laser scanners, making them ideal for high-speed retail and logistics settings. When working with high-volume scanning applications, explore our [reading speed options](https://ironsoftware.com/csharp/barcode/how-to/reading-speed-options/) to optimize performance.

Let's explore the most supported formats and how to create them with IronBarcode.

### How Do I Create Code-128 Barcodes?

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 small spaces. This makes Code 128 ideal for warehouse management systems and inventory tracking where space is limited but data density is crucial.

However, it doesn't natively support Unicode or non-Latin characters without additional extensions. It cannot handle complex characters from languages like Chinese or Arabic and would misinterpret the data, leading to incorrect output. For applications requiring Unicode support, see our guide on [writing Unicode barcodes](https://ironsoftware.com/csharp/barcode/how-to/writing-in-unicode/).

#### What Code Do I Need?

IronBarcode makes generating Code-128 straightforward: pass `BarcodeEncoding.Code128` as the second parameter when calling the `Create` method, then export as an image. Learn more about [creating barcode images](https://ironsoftware.com/csharp/barcode/how-to/create-barcode-images/) with various formats and options.

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

What Does the Output Look Like?

Code-128 Example Output

How Do I Create GSI-128 Barcodes?

GS1-128 is an additional data format applied on top of Code 128. The main advantage of GS1-128 is consistent global data interpretation, eliminating misinterpretation and ambiguity. This standardization is crucial for supply chain management where products move between different companies and countries.

However, due to strict formatting, missing a hidden control character or incorrect field length will render the barcode non-compliant. If you encounter issues with GS1-128 formatting, our GS1-128 troubleshooting guide can help resolve common problems.

What Format Does GSI-128 Require?

Barcode scanners use Application Identifiers (AI) ‒ numeric prefixes that identify the information in the product code. Understanding these identifiers is crucial for creating compliant barcodes that work across the global supply chain.

GS1-128 follows this four-part data structure:

(Numeric prefix 01) GTIN (Global Trade Item Number): The unique product ID that identifies what the product is. Must be exactly 14 numeric digits. If your product code is shorter, pad with leading zeros. For example, 123456789012 becomes 00123456789012.

(Numeric prefix 10) Batch/Lot: The batch or lot number of the product. 1 to 20 alphanumeric characters. When placed mid-barcode, requires FNC1 separator character so scanners know where it ends. No separator needed if at barcode end.

(Numeric prefix 17) Expiration Date: The product's expiration date. Fixed at six digits following YYMMDD format. For example, 251231 is December 31, 2025. Uses 2-digit years with sliding window for century.

(Numeric prefix 21) Serial Number: The product's serial number identifying the unique individual unit. Variable-length with 1-20 alphanumeric characters.

Please noteOnly the GTIN is required; batch, expiry, and serial attributes are optional.

WarningWhile only GTIN is required, some retailers have specific compliance guidelines. Check their requirements when creating barcodes.

How Do I Generate GSI-128 with IronBarcode?

Generating a GS1-128 barcode is easy; 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 exports it as an image.

Please noteBracket parentheses are required for each numeric prefix, or that section won't be recognized as a valid attribute.

Please noteIronBarcode automatically inserts the FNC1 separator 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");
$vbLabelText   $csharpLabel

What Does the GSI-128 Output Look Like?

GS1-128 Example Output

How Do I Fix GSI-128 Format Errors?

If your string doesn't comply with GS1-128 standards, IronBarcode throws an exception. Verify your string value using the table above and modify accordingly.

GS1-128 Exception

How Do I Create Code 39 Barcodes?

Code 39 is one of the first alphanumeric barcode standards, known for reliability. Common in automotive and defense sectors. Its ability to encode letters and numbers without check digits makes it simple for environments where data integrity is verified through other means.

However, Code 39 has a limited character set. It only allows uppercase English characters, digits, and symbols like /, ., -, etc. Standard mode doesn't support lowercase. For information on reading standard and extended Code 39 barcodes, see our Code 39 reading guide.

What Code Do I Need for Code 39?

To generate Code39, pass BarcodeEncoding.Code39 as the second parameter when using Create.

Here's an example:

: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");
$vbLabelText   $csharpLabel

What Does Code 39 Output Look Like?

Code39 Example Output

Why Am I Getting Code 39 Errors?

Code39 Exception

If the string doesn't conform to Code39 standard, IronBarcode throws this exception.

WarningIronBarcode currently doesn't support generating extended Code39 barcodes; only reading is supported. For reading extended and standard Code39, see our Code 39 reading tutorial
.

How Do I Create Code 93 Barcodes?

Code 93 improves on Code 39, commonly used in logistics and electronic component labeling where space is limited but alphanumeric data is required. The improved density suits small electronic components where space matters.

It accepts full ASCII characters, uppercase English letters, digits, and symbols. Offers higher density than Code 39.

What Code Do I Need for Code 93?

To generate Code93, pass BarcodeEncoding.Code93 as the second parameter when using Create:

: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");
$vbLabelText   $csharpLabel

What Does Code 93 Output Look Like?

Code93 Example Output

How Do I Create CodaBar Barcodes?

Codabar is robust against poor print quality, widely used in blood banks and libraries. The format's error tolerance is ideal for low-quality printers or wear and tear.

Variable-length but limited character set. Contains only digits (0-9) and symbols (-, $, :, /, ., +). Start/stop characters A, B, C, D indicate beginning or end. These characters can't appear mid-barcode.

What Code Do I Need for CodaBar?

To generate Codabar, pass BarcodeEncoding.Codabar as the second parameter when using Create:

: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");
$vbLabelText   $csharpLabel

What Does CodaBar Output Look Like?

Codabar Example Output

Why Is CodaBar Throwing Errors?

If input contains letters, IronBarcode throws an exception stating it only accepts numeric values.

Codabar Exception

How Do I Create DataBar Barcodes?

GS1 DataBar (formerly RSS-14) is more compact, designed for product identification numbers. Useful for small items like fresh produce where traditional barcodes take too much space. Learn more about newer format capabilities in our new formats milestone update.

Like GS1-128, it has strict encoding format. The Omnidirectional variant contains only the product code attribute.

What Format Does GS1-DataBar Require?

(Numeric prefix-01) GTIN (Global Trade Item Number): The unique product ID. Must be exactly 14 numeric digits.

WarningStandard "GS1 DataBar Omnidirectional" can only hold GTIN (01). Use GS1 DataBar Expanded for additional attributes.

How Do I Generate GS1 DataBar Code?

To generate GS1 DataBar, pass BarcodeEncoding.DataBar as the second parameter when using Create:

: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");
$vbLabelText   $csharpLabel

What Does DataBar Output Look Like?

GS1-Databar Example Output

How Do I Create EAN-13 Barcodes?

EAN-13 is the standard retail barcode used worldwide for consumer products—one of the most widely used formats. For retail applications, explore how to customize barcode styling to match brand requirements.

EAN-13 requires strict licensing. You can't generate EAN-13 numbers for public use without licensing a GS1 Company Prefix to ensure unique barcodes. Contains only 13 numeric digits. For licensing information, visit our licensing page.

EAN-13 has specific formatting rules.

What Format Does EAN-13 Require?

EAN-13 barcode consists of four parts:

GS1 Prefix (First 3 Digits): Identifies GS1 Member Organization, typically registration country. Examples: 000-019 (USA/Canada - UPC compatible), 500-509 (UK), 450-459 (Japan).

Manufacturer Code: Variable-length code assigned by GS1.

Product Code: Assigned by manufacturer to specific item.

Check Digit (Last Digit): Calculated from first 12 using Modulo 10 algorithm. Ensures accurate scanner reading.

WarningPrefixes 200-299 are reserved for restricted circulation. Don't use these prefixes in production when generating EAN-13 barcodes.

How Do I Generate EAN-13 Code?

To generate EAN-13, pass BarcodeEncoding.EAN13 as the second parameter when using Create:

: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");
$vbLabelText   $csharpLabel

What Does EAN-13 Output Look Like?

EAN-13 Example Output

How Do I Fix EAN-13 Format Errors?

IronBarcode throws an exception for non-numeric values.

EAN-13 Troubleshooting

How Do I Create EAN-8 Barcodes?

EAN-8 is the condensed EAN-13 version for small consumer products where full-size barcodes take too much space. Common on pencils and cosmetics where packaging space is limited.

Unlike Code 128 or Code 39, EAN-8 uses specific assigned prefixes rather than arbitrary numbers.

EAN-8 uses strict 8-digit format: 7 data digits and 1 check digit. Numeric only.

What Code Do I Need for EAN-8?

Creating EAN-8 requires passing BarcodeEncoding.EAN8 to the second parameter when using Create:

: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");
$vbLabelText   $csharpLabel

What Does EAN-8 Output Look Like?

EAN-8 Example Output

Why Am I Getting EAN-8 Length Errors?

If input contains 8+ numeric characters, IronBarcode throws an exception stating EAN-8 requires 8 characters.

EAN-8 Exception

How Do I Create Intelligent Mail Barcodes?

Intelligent Mail Barcode (IMB) is the USPS standard for automating mail sorting and tracking. Unlike traditional width-modulated barcodes, IMB uses height-modulated bars. Mandatory for automation price discounts on letters and flats. Supports only specific numeric lengths: 20, 25, 29, or 31 digits.

Uses specific numeric prefixes to define information.

What Format Does Intelligent Mail Require?

(First 2 Digits) Barcode ID: The Barcode Identifier. Strictly 2 numeric digits. Usually 00 for standard commercial mail.

(Next 3 Digits) Service Type ID (STID): Defines mail class (e.g., First Class, Marketing Mail) and services (e.g., Address Correction, Tracking). Critical for postal discounts.

(Next 6 or 9 Digits) Mailer ID (MID): 6- or 9-digit number assigned by USPS to your company.

(Next 6 or 9 Digits) Serial Number: Identifies unique individual mailpiece.

(Last 0, 5, 9, or 11 Digits) Routing Code: Delivery ZIP code.

How Do I Generate Intelligent Mail Code?

To generate IMB, pass BarcodeEncoding.IntelligentMail as the second parameter when calling Create:

: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");
$vbLabelText   $csharpLabel

What Does Intelligent Mail Output Look Like?

Intelligent Mail Example Output

How Do I Fix Intelligent Mail Format Errors?

IronBarcode throws an exception if format is incorrect. Verify string value against format above and retry after modification.

Intelligent Mail Exception

How Do I Create MSI Barcodes?

MSI is common on retail shelf tags and warehouse inventory control, rarely on consumer products. Its simplicity and reliability make it popular for internal operations. For MSI recognition issues, check our MSI barcode troubleshooting guide.

MSI is numeric-only; no letters or symbols allowed. Variable length, typically 10-15 digits.

What Code Do I Need for MSI?

To generate MSI, pass BarcodeEncoding.MSI as the second parameter when calling Create:

: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");
$vbLabelText   $csharpLabel

What Does MSI Output Look Like?

MSI Example Output

How Do I Create UPC-A Barcodes?

UPC-A is the standard retail barcode for United States and Canada. A 12-digit subset of EAN-13. Most common on products in North American supermarkets. Widespread adoption makes it essential for North American markets.

Like EAN-13, typically assigned rather than generated.

UPC-A contains exactly 12 numeric digits. No letters accepted.

What Format Does UPC-A Require?

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

Manufacturer Code (5): Assigned by GS1.

Product Code (5): Assigned by manufacturer.

Check Digit (1): Calculated modulo 10 checksum.

How Do I Generate UPC-A Code?

To generate UPC-A, pass BarcodeEncoding.UPCA as the second parameter when calling Create:

: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");
$vbLabelText   $csharpLabel

What Does UPC-A Output Look Like?

UPC-A Example Output

Why Am I Getting UPC-A Length Errors?

IronBarcode throws an error if the numeric value exceeds 13 in length.

UPC-A Exception class=

How Do I Create UPC-E Barcodes?

UPC-E is the compact UPC-A version for small retail packaging like soda cans where full 12-digit UPC-A is too large. The compression algorithm encodes the same information in roughly half the space.

Like UPC-A, strictly numeric. No letters or symbols accepted.

What Code Do I Need for UPC-E?

To generate UPC-E, pass BarcodeEncoding.UPCE as the second parameter when calling Create:

: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");
$vbLabelText   $csharpLabel

What Does UPC-E Output Look Like?

UPC-E Example Output

How Do I Fix UPC-E Length Errors?

IronBarcode throws an error if numeric digits exceed 8.

UPC-E Troubleshooting

What Are the 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 types of 1D barcodes can be generated?

IronBarcode can generate all major 1D barcode formats including Code 128, GS1-128, Code 39, Code 93, EAN-13, EAN-8, UPC-A, UPC-E, Intelligent Mail, MSI, Codabar, and DataBar. Each format is suitable for different applications - Code 128 for shipping labels, EAN-8 for small products, and Intelligent Mail Barcode for postal services.

How do I create a basic 1D barcode in C#?

To create a 1D barcode with IronBarcode, use the BarcodeWriter.CreateBarcode() method with your data string and specify the barcode type using the BarcodeEncoding enum. For example: GeneratedBarcode barcode = BarcodeWriter.CreateBarcode("HELLO-WORLD-123", BarcodeEncoding.Code128);

What output formats are supported for saving barcodes?

IronBarcode supports saving generated barcodes in multiple formats including JPEG, PNG, and PDF. You can use methods like SaveAsJpeg(), SaveAsPng(), or other SaveAs methods to export your barcode in the desired format.

Can I customize the size and appearance of generated barcodes?

Yes, IronBarcode allows you to customize barcode dimensions using the ResizeTo() method. You can also apply optional styling with font size and margins to ensure the barcode fits your specific requirements.

Does the library include automatic validation for barcode formats?

IronBarcode includes automatic validation and compliance checking for all supported barcode formats. This ensures that generated barcodes meet industry standards and will be scannable by standard barcode readers.

Why should I use linear barcodes instead of 2D barcodes?

Linear barcodes remain the industry standard because they are fast, reliable, and work with almost any scanner. Since they don't require complex image processing, IronBarcode's linear barcodes excel in high-speed environments like retail checkout lines and conveyor belts.

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 2,015,591 | Version: 2025.12 just released