IRONSOFTWAREHOME
Read Code 39 Barcodes
using IronBarCode;
using System;

// Set the option to read single code 39 barcode
BarcodeReaderOptions options = new BarcodeReaderOptions()
{
    ExpectBarcodeTypes = BarcodeEncoding.Code39
};

// Read barcode
var results = BarcodeReader.Read("code39.png", options);

foreach (var result in results)
{
    Console.WriteLine(result.ToString());
}
Imports IronBarCode
Imports System

' Set the option to read single code 39 barcode
Dim options As New BarcodeReaderOptions() With {
    .ExpectBarcodeTypes = BarcodeEncoding.Code39
}

' Read barcode
Dim results = BarcodeReader.Read("code39.png", options)

For Each result In results
    Console.WriteLine(result.ToString())
Next
NuGet Download
PM > Install-Package BarCode
Read Code 39 Barcodes

Read Code 39 Barcodes

A Code 39 barcode is a popular barcode format that can vary in length. It is one of the most widely used types of barcodes. Standard Code 39 is capable of encoding uppercase letters (A-Z), digits (0-9), and a handful of special characters (such as space, -, $, +, %, and .).

Additionally, the Extended mode of Code 39 handles all ASCII characters. This format is highly versatile and is a popular choice for inventory, logistics, and industrial applications. IronBarcode fully supports reading both the standard and extended modes of Code 39. In this code example, we demonstrate how to read a Code 39 barcode with IronBarcode and print out the results.

4-step guide to reading Code39 Barcode

  • BarcodeReaderOptions options = new BarcodeReaderOptions();
  • options.ExpectBarcodeTypes = BarcodeEncoding.Code39;
  • var results = BarcodeReader.Read("code39.png", options);
  • Console.WriteLine(result.ToString());

Code Explanation

We first import the IronBarcode library. Then, we create a BarcodeReaderOptions object. We set its ExpectBarcodeTypes property to BarcodeEncoding.Code39 to optimize the reader, telling it to only look for Code 39 barcodes.

After creating the options object, we call the BarcodeReader.Read method. We pass two arguments to this method: the path to the barcode image and the options object we just configured. In the example above, these are "code39.png" and options, respectively.

This method returns a collection of BarcodeResult objects. Finally, we can access a result from the result collection and print its decoded string value to the console using Console.WriteLine(result.ToString()).

Discover How to Effortlessly Read Code 39 Barcodes Using C# and IronBarcode!
View on GitHub

Ready to Get Started?

Nuget Downloads 2,422,100Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required