.NET & C# QR Code Scanner SDK

Add offline QR code scanning directly inside your C# service or desktop application. Install one MIT-licensed NuGet package carrying bundled native libraries for five systems, scan image bytes or RGBA frames in process and read 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() and receive decoded text, raw bytes, QR quality score and report.Json.

Shell
dotnet add package QRCodeAI.QRCodeBarcodeScanner

Want 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 license

    MIT

Run in-process QR scanning in .NET

Load the bundled native Rust library 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() and receive decoded text, raw bytes, QR quality score and report.Json.

Scan raw RGBA frames

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

Typed C# report & options

Configure Profile, BudgetMs, Formats and MaxDimension via ScanOptions, and handle refusals cleanly through ScanException.

Add 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 tested on .NET 8 and .NET 10 (.NET 10 is the current Microsoft LTS release).

Native libraries are bundled for five systems: Linux x64 and arm64 (glibc 2.28+), macOS Intel (10.15+) and Apple Silicon (11+), and Windows x64. Alpine and other musl Linux distributions are not covered.

Shell
dotnet add package QRCodeAI.QRCodeBarcodeScanner

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

Every fresh-install check runs across all five supported OS/architecture combinations 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 with Task.Run in UI or web request paths if needed).

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 (reduced scoring) and ScanProfile.Full (default of Scan).

Leave BudgetMs omitted 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 is "https://qrcode-ai.com/". Read report.Score (0 to 100, or null when unmeasured) and report.Json when you need full geometry, payloads or trace fields.

No QR code found sets report.Found to false without throwing. Refusals throw ScanException with Case (ScanFailed carrying 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 clean C# API (Scanner, ScanOptions, ScanProfile, ScanReport, Detection and ScanException) with zero subprocess overhead.

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

Runtime floors and MIT license. Runs on .NET 8 and .NET 10 across five glibc/macOS/Windows targets (no musl). Current releases are MIT-licensed; see the .NET binding README.

.NET QR Code Scanner documentation and license

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 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 tested on .NET 8 and .NET 10 (.NET 10 is the current Microsoft 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 other musl Linux images are not supported.

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

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

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

Yes. report.Json holds the exact JSON string produced by the engine with nothing renamed or rounded, so you can parse structured payloads, geometry and trace fields with System.Text.Json.

No. The native library is bundled inside the NuGet package and runs 100% locally in process with no subprocess, no network requests, no QR Code AI account and no creation credits.

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