.NET & C# QR Code Scanner SDK

Run offline QR code scanning directly inside your C# service or desktop app. Install one MIT-licensed NuGet package with bundled native libraries for five systems, decode image bytes or RGBA frames in process and inspect typed detections and QR scores.

Text
using System.Linq;
using QRCodeAI.QRCodeBarcodeScanner;

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

Console.WriteLine(qr?.Text);

Inspect the decoded resulthttps://qrcode-ai.com/

Read saved QR images

Pass PNG, JPEG, WebP or GIF bytes to Scanner.Scan() to get decoded text, raw bytes, the QR quality score and report.Json.

Shell
dotnet add package QRCodeAI.QRCodeBarcodeScanner

Need to scan a code now? Open the online reader

.NET & C# QR Code Scanner SDK at a glance

  • QRCodeAI.QRCodeBarcodeScanner

    NuGet

  • Linux glibc, macOS & Windows x64

    5 OS/arch

  • Thread-safe, zero subprocesses

    In-process

  • Open-source licence

    MIT

Run in-process QR scanning in .NET

Load the bundled native Rust library directly inside C# services and desktop apps with zero subprocesses or network calls.

Read saved QR images

Pass PNG, JPEG, WebP or GIF bytes to Scanner.Scan() to get decoded text, raw bytes, the QR quality score and report.Json.

Scan raw RGBA frames

Pass width, height and RGBA pixel bytes to Scanner.ScanFrame(). Both methods stay thread-safe across concurrent .NET tasks.

Typed C# report & options

Set Profile, BudgetMs, Formats and MaxDimension via ScanOptions, and handle refusals cleanly with ScanException.

Set up QR image reading in C# and .NET

Install the NuGet package, pass image bytes to Scanner.Scan and inspect detections and score.

Add the NuGet package

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

Bundled native libraries cover five platforms: Linux x64 and arm64 (glibc 2.28+), macOS Intel (10.15+) and Apple Silicon (11+), and Windows x64. Alpine and other musl Linux images are not supported.

Shell
dotnet add package QRCodeAI.QRCodeBarcodeScanner

No external CLI binary or Rust toolchain is required; the managed assembly loads its bundled native UniFFI library automatically.

Fresh-install checks run across all five supported OS and architecture targets before release.

Decode a QR image in C#

Call Scanner.Scan with PNG, JPEG, WebP or GIF bytes and an optional ScanOptions record. Both Scanner.Scan and Scanner.ScanFrame are thread-safe and synchronous (offload via Task.Run in UI or web request paths where appropriate).

Text
using QRCodeAI.QRCodeBarcodeScanner;

var bytes = File.ReadAllBytes("label.png");
var options = new ScanOptions
{
    Profile = ScanProfile.Full,
    Formats = ["qr_code"],
    BudgetMs = 0,
};

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

Profiles: ScanProfile.Frame (decode only, Score is null), ScanProfile.Fast (lighter scoring) and ScanProfile.Full (default for Scan).

Omit BudgetMs to keep the profile default, or set BudgetMs = 0 for an unbounded scan. Check report.Complete before treating empty results as final.

Inspect the decoded result

For a QR image encoding https://qrcode-ai.com/, detection.Text holds "https://qrcode-ai.com/". Check report.Score (0 to 100, or null when unmeasured) and read report.Json when you need full geometry, payloads or trace fields.

When no QR code is found, report.Found is false and nothing is thrown. Refusals throw ScanException carrying Case (ScanFailed with Code such as QRS-001, option errors or EngineFault).

.NET native architecture, ScanOptions and error handling

Six public types over UniFFI. The NuGet package wraps internal uniffi-bindgen-cs bindings behind a concise C# API (Scanner, ScanOptions, ScanProfile, ScanReport, Detection and ScanException) with no subprocess overhead.

Options and limits. Configure MaxDimension, MaxPixels, Formats, AlphaBackground, AlphaPalette and scoring presets through ScanOptions (see option domains). Treat decoded strings as untrusted input.

Runtime floors and MIT licence. Runs on .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 QR Code Scanner documentation and licence

Official package documentation, ScanReport specification and licensing references.

.NET & C# QR Code Scanner SDK questions

NuGet, .NET 8/10, native targets, thread safety, ScanException and licensing.

It is QR Code AI’s open-source MIT-licensed NuGet package (QRCodeAI.QRCodeBarcodeScanner) that bundles the native Rust engine directly inside a managed .NET library, decoding QR codes, Micro QR, rMQR and 16 barcode formats in process.

The package targets .NET 8 and is verified on .NET 8 and .NET 10 (.NET 10 is Microsoft’s current LTS release). Bundled native libraries support Linux x64/arm64 (glibc 2.28+), macOS Intel (10.15+) and Apple Silicon (11+), and Windows x64. Alpine and other musl Linux images are not covered.

Yes. Both methods run synchronously on the calling thread and are safe to invoke concurrently across .NET threads or Task.Run workers without shared mutable state.

Yes. Pass four bytes per pixel in RGBA order to Scanner.ScanFrame(rgba, width, height, options). Its default profile is ScanProfile.Frame (decode only, no scoring).

If no code is detected, report.Found is false and no exception is thrown (verify that report.Complete is true). A null Score means unmeasured, never zero. Invalid inputs or options throw ScanException carrying a typed Case and optional engine Code such as QRS-001.

Yes. report.Json contains the exact JSON string output by the engine with no fields renamed or rounded, ready to parse with System.Text.Json for structured payloads, geometry and trace data.

No. The native library ships inside the NuGet package and runs 100% locally in process with zero subprocesses, zero network requests, no QR Code AI account, no API key and no creation credits.

Yes. Current releases carry the MIT licence for commercial and proprietary software 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.