IRONSOFTWAREHOME

.NET MAUI QR Code Scanner

Curtis Chau
Curtis Chau
Updated: March 3, 2026

Introduction

.NET MAUI (.NET Multi-platform App UI) is a cross-platform framework for building native mobile and desktop applications from a single C# codebase. A single project can target Android, iOS, macOS, and Windows, sharing UI layouts and business logic across all platforms. MAUI's integration with the .NET ecosystem means developers can reach mobile users without abandoning familiar tooling or languages.

In this article, we'll explain how to build a native QR code scanner in a .NET MAUI application using IronQR to decode QR codes selected from the device's photo library.

IronQR: C# QR Code Library

To read QR codes in the application, we'll use the IronQR .NET library. It provides a straightforward API for detecting and decoding QR codes from any image source, including files selected on a mobile device. IronQR runs on all MAUI target platforms and requires no barcode domain knowledge to integrate.

IronQR can decode standard QR codes, Micro QR codes, and rMQR codes, and accepts image input as files, streams, or bitmaps. It can be installed in seconds via the NuGet Package Manager.

Steps to Build a QR Code Scanner in .NET MAUI

Follow these steps to add QR code scanning to a .NET MAUI application.

Prerequisites

  1. Visual Studio 2022 with the .NET MAUI workload installed
  2. A .NET MAUI project targeting Android or iOS

Install IronQR

Install the IronQR library using the NuGet Package Manager Console in Visual Studio. Navigate to Tools > NuGet Package Manager > Package Manager Console and run:

PM > Install-Package IronQR

Alternatively, search for IronQR on NuGet and install the latest version.

Front-End Design

The scanner UI consists of a button to trigger image selection, an image view to preview the selected QR code, and a label to display the decoded result.

Replace the content of MainPage.xaml with the following:

<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiQrScanner.MainPage">

    <ScrollView>
        <VerticalStackLayout
            Spacing="25"
            Padding="30,0"
            VerticalOptions="Center">

            <Button
                x:Name="scanButton"
                Text="Select QR Code Image"
                SemanticProperties.Hint="Select Image"
                Clicked="OnScanButtonClicked"
                HorizontalOptions="Center" />

            <Image
                x:Name="qrImage"
                SemanticProperties.Description="Selected QR Code"
                HeightRequest="200"
                HorizontalOptions="Center" />

            <Label
                x:Name="resultLabel"
                Text="Scanned Text: "
                HorizontalOptions="Center"
                VerticalOptions="Center" />

        </VerticalStackLayout>
    </ScrollView>

</ContentPage>
XML

Sample Input

Use the QR code below as a test image. Save it to your device, then select it through the app's file picker. The decoded value should display as https://ironsoftware.com.

Sample QR code encoding https://ironsoftware.com for testing the .NET MAUI QR scanner

Sample QR code - encodes https://ironsoftware.com

QR Code Scanning with IronQR

When the scan button is tapped, FilePicker opens the device's image library. After the user selects a photo, the full path is loaded into an AnyBitmap, which is passed to QrReader.Read(). The decoded value from the first detected QR code is displayed in the result label.

Add the following method to MainPage.xaml.cs:

using IronQr;
using IronSoftware.Drawing;

private async void OnScanButtonClicked(object sender, EventArgs e)
{
    // Start scanning QR codes
    var images = await FilePicker.Default.PickAsync(new PickOptions
    {
        PickerTitle = "Pick image",
        FileTypes = FilePickerFileType.Images
    });
    var imageSource = images.FullPath.ToString();

    var inputBmp = AnyBitmap.FromFile(imageSource);

    // Load the asset into QrImageInput
    QrImageInput imageInput = new QrImageInput(inputBmp);

    // Create a QR Reader object
    QrReader reader = new QrReader();

    // Read the input and get all embedded QR Codes
    IEnumerable<QrResult> results = reader.Read(imageInput);

    // Display the first result
    resultLabel.Text = "Scanned Text: " + results.First().Value;
}

FilePicker.Default.PickAsync is provided by the MAUI platform abstraction layer and works on Android, iOS, and Windows without any platform-specific code. AnyBitmap.FromFile handles image decoding, and QrReader.Read returns an IEnumerable<QrResult> with one entry per QR code found in the image.

Output

Selecting a QR code image triggers the scan. The decoded value appears in the result label below the image preview.

.NET MAUI QR Code Scanner using IronQR — app selecting a QR code image and displaying the decoded value

QR code selected and decoded value displayed in the result label

Download the Project

Click here to download the complete MauiQrScanner project.

Conclusion

In this article, we demonstrated how to build a native QR code scanner in a .NET MAUI application using IronQR. The FilePicker API provides platform-native image selection on Android, iOS, and Windows, while IronQR's QrReader.Read handles the decoding in a single call. The same approach scales to multiple QR codes per image by iterating over the full results collection instead of calling .First().

IronQR requires a license for development and commercial use. Licensing details are available here.

For a deeper look at reading QR code properties beyond the value, see the Read QR Code Value and Read QR Code Type guides.

Frequently Asked Questions

What is .NET MAUI?

.NET MAUI (Multi-platform App UI) is a cross-platform framework that allows developers to build native mobile and desktop applications using a single C# codebase. It supports platforms like Android, iOS, macOS, and Windows, enabling shared UI layouts and business logic.

How can I build a QR code scanner using .NET MAUI and IronQR?

To build a QR code scanner in .NET MAUI using IronQR, you should install the IronQR library, design your application layout in MainPage.xaml, use FilePicker to select QR code images, and call QrReader.Read() to decode the QR code.

What platforms does the IronQR library support?

IronQR supports all .NET MAUI target platforms, including Android, iOS, macOS, and Windows, making it versatile for cross-platform QR code scanning applications.

What types of QR codes can IronQR decode?

IronQR can decode standard QR codes, Micro QR codes, and rMQR codes, allowing for a wide range of QR code scanning capabilities.

What are the steps to integrate IronQR into a .NET MAUI project?

Integration involves installing the IronQR library via NuGet Package Manager, designing your app's UI, using FilePicker to select an image, creating a QrImageInput, and calling QrReader.Read() to decode the QR code.

How can I install IronQR in Visual Studio?

You can install IronQR in Visual Studio using the NuGet Package Manager. Navigate to Tools > NuGet Package Manager > Package Manager Console and run the command :ProductInstall, or search for IronQR on NuGet and install it.

Can IronQR handle QR code image selection on mobile devices?

Yes, IronQR can be used with MAUI's FilePicker API, which manages image selection natively across Android, iOS, and Windows, allowing users to choose QR code images from their device.

What is the role of FilePicker in a .NET MAUI QR code scanner application?

FilePicker is used to enable users to select QR code images from their device's photo library. This is essential for loading the images into the application for QR code decoding with IronQR.

What is necessary for developing with IronQR?

You need a valid IronQR license for development and commercial use. Details on licensing are available on the Iron Software website.

What are the capabilities of the QRReader.Read method in IronQR?

The QrReader.Read method in IronQR can decode QR codes from various image sources like files, streams, or bitmaps and provides the results as an IEnumerable.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 74,386Version:2026.9just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronQR
nuget.org/packages/IronQR/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronQR"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

  1. Download and unzip IronQR to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronQR.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required