Blazor QR Code Scanner

Use IronQR to scan QR codes in a Blazor Server application. Upload an image through the browser with Blazor's InputFile component, then decode it server-side with QrReader.Read().

5-step guide for scanning a QR code in Blazor

  • using IronQr;
  • using IronSoftware.Drawing;
  • await using var stream = file.OpenReadStream(maxAllowedSize: 10_000_000);
  • var inputBmp = AnyBitmap.FromFile(qrImageSrc!);
  • var results = reader.Read(imageInput);

Code Explanation

InputFile.OnChange fires when the user selects a file. OpenReadStream streams the browser upload to a temporary server path, which is then passed to AnyBitmap.FromFile to decode the image format. A QrImageInput wraps the bitmap for IronQR, and QrReader.Read returns an IEnumerable<QrResult>. FirstOrDefault safely retrieves the first result without throwing on images that contain no QR code.

Discover How to Build a Blazor QR Code Scanner with IronQR.

Ready to Get Started?
Nuget Downloads 60,166 | Version: 2026.3 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package IronQR
run a sample watch your URL become a QR code.