IRONSOFTWAREHOME

How to Read QR Code Values in C#

Curtis Chau
Curtis Chau
Updated: July 21, 2026

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 Value

Load an image, scan it with QrReader, and extract the decoded string.

  1. 1Install IronQR with NuGet Package Manager

    PM > Install-Package IronQR

  2. 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#
  3. 3Deploy to test on your live environment

    Start using IronQR in your project today with a free trial
    arrow pointer

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.

QR code encoding https://ironsoftware.com used as input for scanning
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}");

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

Console output showing the decoded QR code value https://ironsoftware.com

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})");
}

Output

Console output showing Value, Url, and Points properties read from a QR code

What Properties Does QrResult Expose?

QrResult exposes the following properties after a successful scan:

PropertyTypeDescription
ValuestringThe 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.
UrlUriA 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.
PointsPointF[]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` allowing you to iterate over each QR code found in the image.

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