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!

Ready to Get Started?
Nuget Downloads 1,935,276 | Version: 2025.11 just released