.NET & C# Barcode Scanner SDK

Run offline 1D and 2D barcode scanning directly inside your C# service or desktop app. Install one MIT-licensed NuGet package with bundled native libraries for five systems, decode label images in process and keep every identifier as an exact string.

Text
using System.Linq;
using QRCodeAI.QRCodeBarcodeScanner;

var report = Scanner.Scan(imageBytes, new ScanOptions { Profile = ScanProfile.Frame });
var barcode = report.Detections.FirstOrDefault(d => d.Symbology == "code128");

Console.WriteLine(barcode?.Text);

Inspect the decoded identifierSTOCK-4827

Read label images

Pass PNG, JPEG, WebP or GIF label bytes to Scanner.Scan(). A Code 128 label encoding STOCK-4827 returns that exact string.

Shell
dotnet add package QRCodeAI.QRCodeBarcodeScanner

Need to scan a barcode now? Open the online reader

.NET & C# Barcode Scanner SDK at a glance

  • QRCodeAI.QRCodeBarcodeScanner

    NuGet

  • Linux glibc, macOS & Windows x64

    5 OS/arch

  • EAN, UPC, Code 128, Data Matrix & more

    1D + 2D

  • Open-source licence

    MIT

Run in-process barcode scanning in .NET

Decode 1D retail, warehouse and 2D matrix labels inside C# services and desktop apps with bundled native libraries.

Read label images

Pass PNG, JPEG, WebP or GIF label bytes to Scanner.Scan(). A Code 128 label encoding STOCK-4827 returns that exact string.

Scan raw RGBA frames

Pass raw RGBA pixels with width and height to Scanner.ScanFrame(). Both methods stay thread-safe across concurrent .NET tasks.

Keep exact strings & formats

Restrict symbologies via ScanOptions.Formats and keep Detection.Text as a C# string so leading zeros remain intact.

Set up barcode image reading in C# and .NET

Install the NuGet package, restrict symbologies in ScanOptions and return exact identifier strings.

Add the NuGet package

Install QRCodeAI.QRCodeBarcodeScanner on NuGet. Targets .NET 8 and is verified on .NET 8 and .NET 10 (.NET 10 is Microsoft’s current LTS release).

Ships native libraries for Linux x64/arm64 (glibc 2.28+), macOS Intel (10.15+) and Apple Silicon (11+), and Windows x64. Alpine and musl Linux images are not supported.

Shell
dotnet add package QRCodeAI.QRCodeBarcodeScanner

No external CLI binary or Rust toolchain is needed; the managed package loads its bundled native UniFFI library in process.

Fresh-install verification runs across all five supported OS and architecture platforms.

Decode a barcode image in C#

Pass encoded label bytes (PNG, JPEG, WebP or GIF) and ScanOptions.Formats to Scanner.Scan so only the selected barcode readers execute.

To test against a known sample, create a Code 128 barcode with Barcode Generator encoding STOCK-4827 and scan the exported PNG.

Text
using QRCodeAI.QRCodeBarcodeScanner;

var bytes = File.ReadAllBytes("label.png");
var options = new ScanOptions
{
    Profile = ScanProfile.Frame,
    Formats = ["code128", "code39", "ean13", "ean8", "upc_a", "upc_e", "itf", "data_matrix"],
};

var report = Scanner.Scan(bytes, options);
foreach (var detection in report.Detections)
{
    Console.WriteLine($"{detection.Symbology}: {detection.Text}");
}

Switch to ScanProfile.Full or set BudgetMs = 0 for low-contrast or damaged labels. Always check report.Complete before treating empty results as final.

Add pdf417, aztec, code93, codabar, data_bar, data_bar_expanded, telepen or maxi_code to Formats as required.

Inspect the decoded identifier

For a Code 128 label encoding STOCK-4827, detection.Symbology is "code128" and detection.Text is "STOCK-4827". A UPC-A value such as 012345678905 stays a C# string with its leading zero intact.

When no barcode matches, report.Found is false without throwing. Invalid files or unknown options throw ScanException with Case and an optional engine Code such as QRS-001.

.NET barcode coverage, thread safety and runtime floors

Sixteen barcode formats. Decodes EAN-13, EAN-8, UPC-A, UPC-E, Code 128, Code 39, Code 93, Codabar, ITF, Telepen, GS1 DataBar, GS1 DataBar Expanded, Data Matrix, PDF417, Aztec and MaxiCode (ISBN maps to ean13, GS1-128 to code128, ITF-14 to itf).

Concurrency and options. Scanner.Scan and Scanner.ScanFrame are thread-safe in process; configure MaxDimension, MaxPixels and Formats via ScanOptions (see option domains). Parse report.Json for GS1 payloads and keep product catalogue lookups separate.

Runtime floors and MIT licence. Supports .NET 8 and .NET 10 across five glibc/macOS/Windows targets (no musl). Current releases carry the MIT licence; see the .NET binding README.

.NET Barcode Scanner documentation and licence

Official package documentation, ScanReport specification and licensing references.

.NET & C# Barcode Scanner SDK questions

NuGet, formats, leading zeros, native targets, thread safety and licensing.

It is QR Code AI’s open-source MIT-licensed NuGet package (QRCodeAI.QRCodeBarcodeScanner) that bundles the native Rust engine in process for .NET 8 and .NET 10, decoding 16 1D and 2D barcode formats plus QR codes.

It decodes EAN-13, EAN-8, UPC-A, UPC-E, Code 128, Code 39, Code 93, Codabar, ITF, Telepen, GS1 DataBar, GS1 DataBar Expanded, Data Matrix, PDF417, Aztec and MaxiCode, plus QR Code, Micro QR and rMQR. Set ScanOptions.Formats to run only the readers you need.

Targets .NET 8 and is verified on .NET 8 and .NET 10 (.NET 10 is the supported LTS release). Bundled native libraries cover Linux x64/arm64 (glibc 2.28+), macOS Intel (10.15+) and Apple Silicon (11+), and Windows x64. Alpine and musl Linux images are not supported.

No. Each detection returns its Symbology and exact Text string (preserving UPC-A and EAN-13 leading zeros), plus raw bytes and GS1 fields in report.Json. Query your own ERP or product catalogue separately.

Yes. Both Scanner.Scan and Scanner.ScanFrame are thread-safe and synchronous in process, allowing concurrent ASP.NET Core requests or background workers to invoke them safely.

When no barcode matches, report.Found is false and nothing is thrown (confirm that report.Complete is true). Invalid files, size-limit violations or invalid options throw ScanException with a typed Case and optional engine Code such as QRS-001.

No. The bundled native library executes 100% locally inside your .NET process with no external binary, zero network calls, no QR Code AI account, no API key and no creation credits.

Yes. Current releases carry the MIT licence for commercial and proprietary systems while retaining copyright and licence notices (see LICENSING.md). SDK use is separate from QR Code AI’s paid creation plans and seven-day Premium trial.