.NET MAUI QR Code Scanner
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.
How to Build a QR Code Scanner in .NET MAUI
- Install the IronQR C# library to scan QR codes on mobile
- Design the application layout in
MainPage.xaml - Use
FilePickerto let the user select a QR code image from the device - Load the image and wrap it in a
QrImageInput - Call
Readand display the decoded value in aLabel
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
- Visual Studio 2022 with the .NET MAUI workload installed
- 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:
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>
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 - 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;
}Imports IronQr
Imports IronSoftware.Drawing
Private Async Sub OnScanButtonClicked(sender As Object, e As EventArgs)
' Start scanning QR codes
Dim images = Await FilePicker.Default.PickAsync(New PickOptions With {
.PickerTitle = "Pick image",
.FileTypes = FilePickerFileType.Images
})
Dim imageSource = images.FullPath.ToString()
Dim inputBmp = AnyBitmap.FromFile(imageSource)
' Load the asset into QrImageInput
Dim imageInput As New QrImageInput(inputBmp)
' Create a QR Reader object
Dim reader As New QrReader()
' Read the input and get all embedded QR Codes
Dim results As IEnumerable(Of QrResult) = reader.Read(imageInput)
' Display the first result
resultLabel.Text = "Scanned Text: " & results.First().Value
End SubFilePicker.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.

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 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.