IronBarcode How-Tos Read Multiple Barcodes How to Read Multiple Barcodes at Once Hairil Hasyimi Bin Omar Updated:July 28, 2025 Reading multiple barcodes simultaneously is crucial for various industries, including logistics, retail, healthcare, and inventory management, as it enables efficient data processing. With IronBarcode, you can easily achieve this capability, making it a powerful tool for streamlining operations and enhancing productivity. Get started with IronBarcode Start using IronBarcode in your project today with a free trial. First Step: Start for Free How to Read Multiple Barcodes at Once Download the C# library to read multiple barcodes Use the Read method to extract barcode values from various image formats Utilize the ExpectMultipleBarcodes property to configure reading of single or multiple barcodes Set the ExpectMultipleBarcodes property to false to increase performance Print out the barcode values Read Multiple Barcodes Example By default, IronBarcode continuously scans a document to read multiple barcodes. However, there have been instances where only one barcode value is returned, even when multiple barcodes are present in the image. To address this, users can customize the settings to enable reading multiple barcodes, as shown in the code snippet below. Please note that the ExpectMultipleBarcodes property exists in both the BarcodeReaderOptions and PdfBarcodeReaderOptions classes, allowing users to use it for reading barcodes in both images and PDF documents. Sample Image :path=/static-assets/barcode/content-code-examples/how-to/read-multiple-barcodes-read-multiple-barcodes.cs using IronBarCode; using System; // Set the option to read multiple barcodes BarcodeReaderOptions options = new BarcodeReaderOptions() { ExpectMultipleBarcodes = true, ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional, }; // Read barcode var results = BarcodeReader.Read("testbc1.png", options); foreach (var result in results) { Console.WriteLine(result.ToString()); } Imports IronBarCode Imports System ' Set the option to read multiple barcodes Private options As New BarcodeReaderOptions() With { .ExpectMultipleBarcodes = True, .ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional } ' Read barcode Private results = BarcodeReader.Read("testbc1.png", options) For Each result In results Console.WriteLine(result.ToString()) Next result $vbLabelText $csharpLabel By setting ExpectMultipleBarcodes to true in the code snippet, IronBarcode scans the entire document for multiple barcodes and stores them in the BarcodeResults variable. Using a foreach loop, users can easily access and print all the barcode values to the console. Reading Single Barcode Example IronBarcode can read both single and multiple barcodes in an image or PDF. By default, the engine scans the entire document even if there is only one barcode. However, for increased performance when reading a single barcode, you can set ExpectMultipleBarcodes to false. This stops the engine from scanning the entire document after the first barcode is detected, resulting in faster barcode retrieval. The code snippet below demonstrates how to do this. Sample Image :path=/static-assets/barcode/content-code-examples/how-to/read-multiple-barcodes-read-single-barcode.cs using IronBarCode; using System; // Set the option to read single barcode BarcodeReaderOptions options = new BarcodeReaderOptions() { ExpectMultipleBarcodes = false, ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional, }; // Read barcode var results = BarcodeReader.Read("testbc1.png", options); foreach (var result in results) { Console.WriteLine(result.ToString()); } Imports IronBarCode Imports System ' Set the option to read single barcode Private options As New BarcodeReaderOptions() With { .ExpectMultipleBarcodes = False, .ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional } ' Read barcode Private results = BarcodeReader.Read("testbc1.png", options) For Each result In results Console.WriteLine(result.ToString()) Next result $vbLabelText $csharpLabel In the code snippet above, we used the same image with multiple barcodes as before, but this time, we set ExpectMultipleBarcodes to false. As a result, only the first barcode value is returned, and the scanning process stops once the first barcode is retrieved. Performance Comparison Setting ExpectMultipleBarcodes to false can greatly improve the efficiency of reading single barcodes in the image. Using the provided code snippet, here's a rough estimate of the performance difference between setting ExpectMultipleBarcodes to true and false on the same machine: ExpectMultipleBarcodes = true ExpectMultipleBarcodes = false 00.91 second 00.10 second Frequently Asked Questions What is this barcode library? IronBarcode is a library for reading and writing barcodes in .NET applications, enabling efficient data processing in various industries. How can I read multiple barcodes? To read multiple barcodes using IronBarcode, set the ExpectMultipleBarcodes property to true in the BarcodeReaderOptions or PdfBarcodeReaderOptions classes and use the Read method. Why is reading multiple barcodes simultaneously important? Reading multiple barcodes simultaneously is crucial for efficient data processing in industries such as logistics, retail, and healthcare. How do I optimize the barcode library for reading a single barcode? Set the ExpectMultipleBarcodes property to false in IronBarcode to stop scanning after detecting the first barcode, improving performance. Can this library read barcodes from PDF documents? Yes, IronBarcode can read barcodes from both images and PDF documents by configuring the appropriate reader options. What are the performance benefits of setting ExpectMultipleBarcodes to false? Setting ExpectMultipleBarcodes to false in IronBarcode greatly improves performance by reducing the time needed to retrieve a single barcode. What are the steps to read multiple barcodes using this library? Download the C# library, configure the ExpectMultipleBarcodes property in IronBarcode, use the Read method, and print the barcode values. What should I do if only one barcode is returned in an image with multiple barcodes? Ensure that the ExpectMultipleBarcodes property is set to true in IronBarcode to enable reading all barcodes present in the image. Hairil Hasyimi Bin Omar Chat with engineering team now Software Engineer Like all great engineers, Hairil is an avid learner. He’s refining his knowledge of C#, Python, and Java, using that knowledge to add value to team members across Iron Software. Hairil joined the Iron Software team from Universiti Teknologi MARA in Malaysia, where he graduated with a Bachelor's degree in Chemical and Process Engineering. Ready to Get Started? Free NuGet Download Total downloads: 1,743,856 View Licenses