How to Read QR Code Values in C#
Extract decoded text from any QR code image instantly. Get the raw string value ready to display, store, or process in your application.
Reading a QR code's value is the first step in any scanning workflow. A payment terminal needs the transaction ID embedded in a QR code. A warehouse system needs the product reference on a label. A ticket validator needs the booking code printed on an event pass. IronQR makes this straightforward: load the image, pass it to QrReader, and read the decoded string directly from the result.
This guide demonstrates how to extract QR code values from images using the IronQR library. Developers who have not yet generated a QR code should start with the Create QR Code as Image guide first.
Quickstart: Read a QR Code ValueLoad an image, scan it with QrReader, and extract the decoded string.
-
1Install IronQR with NuGet Package Manager
-
2Copy and run this code snippet.
var input = new QrImageInput(AnyBitmap.FromFile("qr-code.png")); var results = new QrReader().Read(input); Console.WriteLine(results.First().Value);C# -
3Deploy to test on your live environment
Start using IronQR in your project today with a free trial
Minimal Workflow (5 steps)
- Download the IronQR C# library to read QR code values
- Load the image and wrap it in a
QrImageInput - Create a
QrReaderinstance and callReadwith the input - Access the decoded string through
QrResult.Value - Guard with
results.Any()before accessing.First()
How Do I Read a QR Code Value from an Image?
To extract the value embedded in a QR code, load the image into a QrImageInput, pass it to QrReader.Read(), and access the Value property on the returned QrResult. The method returns a collection, one result per QR code found in the image.
Input
The QR code below encodes https://ironsoftware.com and will be scanned to extract its value.

using IronQr;
using System.Drawing;
// Import image
var inputImage = Image.FromFile("sample.jpg");
// Load the asset into QrImageInput
QrImageInput imageInput = new QrImageInput(inputImage);
// 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 value of the first QR code found
Console.WriteLine($"QR code value is {results.First().Value}");Imports IronQr
Imports System.Drawing
Imports System.Linq
' Import image
Dim inputImage As Image = Image.FromFile("sample.jpg")
' Load the asset into QrImageInput
Dim imageInput As New QrImageInput(inputImage)
' 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 value of the first QR code found
Console.WriteLine($"QR code value is {results.First().Value}")The Value property returns the raw decoded string exactly as it was encoded: a URL, a number, free text, or any other data. The Read() method always returns an IEnumerable<QrResult>, even when only one QR code is present. If the image contains multiple QR codes, iterate with foreach (var result in results) to process each one. Guard with results.Any() before calling .First() to handle images where no QR code is found.
Output

How Do I Read All QR Code Properties?
Each QrResult exposes three properties that together give the full picture of what was scanned and where it was found in the image. Using the same input QR code from above:
using IronQr;
using IronSoftware.Drawing;
AnyBitmap inputImage = AnyBitmap.FromFile("sample.jpg");
QrImageInput imageInput = new QrImageInput(inputImage);
QrReader reader = new QrReader();
IEnumerable<QrResult> results = reader.Read(imageInput);
QrResult result = results.First();
// Decoded text content of the QR code
Console.WriteLine($"Value: {result.Value}");
// Parsed URL — populated when Value is a valid URL, null otherwise
Console.WriteLine($"Url: {result.Url}");
// Corner coordinates of the QR code in the image [TL, TR, BL, BR]
string[] labels = { "Top-Left", "Top-Right", "Bottom-Left", "Bottom-Right" };
for (int i = 0; i < result.Points.Length; i++)
{
Console.WriteLine($"{labels[i]}: ({result.Points[i].X}, {result.Points[i].Y})");
}Imports IronQr
Imports IronSoftware.Drawing
Dim inputImage As AnyBitmap = AnyBitmap.FromFile("sample.jpg")
Dim imageInput As New QrImageInput(inputImage)
Dim reader As New QrReader()
Dim results As IEnumerable(Of QrResult) = reader.Read(imageInput)
Dim result As QrResult = results.First()
' Decoded text content of the QR code
Console.WriteLine($"Value: {result.Value}")
' Parsed URL — populated when Value is a valid URL, Nothing otherwise
Console.WriteLine($"Url: {result.Url}")
' Corner coordinates of the QR code in the image [TL, TR, BL, BR]
Dim labels As String() = {"Top-Left", "Top-Right", "Bottom-Left", "Bottom-Right"}
For i As Integer = 0 To result.Points.Length - 1
Console.WriteLine($"{labels(i)}: ({result.Points(i).X}, {result.Points(i).Y})")
Next iOutput

What Properties Does QrResult Expose?
QrResult exposes the following properties after a successful scan:
| Property | Type | Description |
|---|---|---|
Value | string | The raw decoded string exactly as encoded. Can hold a URL, plain text, numeric ID, JSON, or any other data. This is the primary property for most applications. |
Url | Uri | A parsed Uri object populated when Value is a valid absolute URL. Use it to open links, validate domains, or extract URL components. Returns null if the value is not a URL. |
Points | PointF[] | Four corner coordinates marking the QR code's position in the source image, ordered [Top-Left, Top-Right, Bottom-Left, Bottom-Right]. Use it to draw bounding boxes, crop regions, or calculate scan area. |
What Are Common Use Cases for QR Code Value Reading?
- Payment terminals: Decode a transaction URL or reference ID from a customer's QR code to initiate a payment flow.
- Ticket validation: Extract a booking reference from a printed or on-screen QR code to verify event entry.
- Inventory management: Read product serial numbers or SKUs from warehouse labels to update stock records.
- Document verification: Pull a record ID or hash from a QR code stamped on a legal or government document.
- User authentication: Decode a one-time token from a QR code to complete a two-factor login step.
For more QR code reading patterns, explore the Read QR Codes from Image guide and the full IronQR feature set.
Frequently Asked Questions
How can I read a QR code value using IronQR in C#?
To read a QR code value using IronQR, load the image into a `QrImageInput`, pass it to a `QrReader` instance, and call the `Read()` method. You can then access the decoded string using the `QrResult.Value` property.
What is the `Value` property in QrResult used for?
The `Value` property in `QrResult` holds the raw decoded string exactly as encoded in the QR code. This could be a URL, text, or any other data format.
Can IronQR read multiple QR codes from one image?
Yes, IronQR can read multiple QR codes from a single image. The `Read()` method returns an `IEnumerable
How do I extract the URL from a QR code using IronQR?
IronQR lets you extract a URL using the `QrResult.Url` property, which is populated when the `Value` is a valid URL. This helps in quickly accessing or validating the URL.
What does the `Points` property in QrResult represent?
The `Points` property in `QrResult` contains coordinates of the QR code's corners in the image. This helps in locating and visualizing the QR code's position.
What are some common use cases for reading QR code values?
Common use cases include payment processing, ticket validation, inventory management, document verification, and user authentication by extracting and using data encoded in QR codes.
How to handle an image with no QR code using IronQR?
Guard the reading process with `results.Any()` before calling `.First()` or processing results to handle situations where no QR code is found in the image.
Can IronQR handle different types of data encoded in QR codes?
Yes, IronQR can decode various data types such as URLs, numeric IDs, text, and JSON, making it versatile for different applications.
Is it possible to use IronQR to read QR codes from real-time camera input?
While this guide focuses on reading from images, IronQR can be integrated into camera systems. You'd capture frames as images and process them using similar methods.
How do I start using IronQR if I haven't generated a QR code yet?
If you haven't generated a QR code yet, you might want to start with the [Create QR Code as Image] guide for generating QR codes before attempting to read them.

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.