How to Read QR Code Type in C#

Identify the format of any scanned QR code at runtime. Read QrResult.QrType to detect the symbology and build type-aware processing logic for diverse input sources.

When an application accepts QR codes from multiple sources, the format is not always predictable. A logistics platform might receive standard QR codes from shipping labels alongside compact Micro QR codes from product tags. A document processing system might scan codes embedded in PDFs alongside those printed on physical media. Reading QrResult.QrType gives the application visibility into which format was detected, making it possible to validate input, route data to the correct handler, or log unsupported formats for review.

This guide demonstrates how to retrieve the QR code format from scan results using the IronQR library. Developers who have not yet scanned a QR code should start with the Read QR Codes from Image guide first.

Quickstart: Read a QR Code Type

Load an image, scan it with QrReader, and access the detected format.

  1. Install IronQR with NuGet Package Manager

    PM > Install-Package IronQR
  2. Copy and run this code snippet.

    var input = new QrImageInput("qr-code.png");
    var results = new QrReader().Read(input);
    Console.WriteLine(results.First().QrType);
  3. Deploy to test on your live environment

    Start using IronQR in your project today with a free trial

    arrow pointer

How Do I Read the QR Code Type?

To read the type of a QR code, load the image into a QrImageInput, pass it to QrReader.Read(), and access QrType on the returned QrResult. The property returns a QrEncoding enum value identifying the detected symbology.

Input

The QR code below encodes https://ironsoftware.com and will be scanned to extract its type.

QR code encoding https://ironsoftware.com used as input for type detection
:path=/static-assets/qr/content-code-examples/how-to/read-qr-code-type.cs
using IronQr;
using System.Drawing;
using System.Linq;

// Import an image containing a QR code
var inputImage = Image.FromFile("sample.jpg");

// Load the asset into a QrImageInput object
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 type of the first QR code found
Console.WriteLine($"The QR type is {results.First().QrType}");
Imports IronQr
Imports System.Drawing
Imports System.Linq

' Import an image containing a QR code
Dim inputImage As Image = Image.FromFile("sample.jpg")

' Load the asset into a QrImageInput object
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 type of the first QR code found
Console.WriteLine($"The QR type is {results.First().QrType}")
$vbLabelText   $csharpLabel

QrType returns a QrEncoding enum value such as QrEncoding.QRCode, QrEncoding.MicroQRCode, or QrEncoding.RMQRCode. This makes it safe to use directly in a switch statement without parsing or string comparison.

Output

Console output showing the detected QR code type

How Do I Route Processing by QR Code Format?

When an application receives QR codes from multiple sources, not every input will be the same format. Use a switch on QrResult.QrType to route each detected code to the correct handler based on its QrEncoding value. This keeps format-specific logic isolated and makes adding new format branches straightforward.

Using the same input QR code from above:

:path=/static-assets/qr/content-code-examples/how-to/read-qr-code-type-all.cs
using IronQr;
using IronQr.Enum;
using System.Drawing;

// Import an image containing QR codes
var inputImage = Image.FromFile("sample.jpg");

// Load the asset into a QrImageInput object
QrImageInput imageInput = new QrImageInput(inputImage);

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

// Read all embedded QR codes from the image
IEnumerable<QrResult> results = reader.Read(imageInput);

// Route processing based on the detected QR code format
foreach (QrResult result in results)
{
    switch (result.QrType)
    {
        case QrEncoding.QRCode:
            Console.WriteLine($"Standard QR Code: {result.Value}");
            break;
        case QrEncoding.MicroQRCode:
            Console.WriteLine($"Micro QR Code: {result.Value}");
            break;
        case QrEncoding.RMQRCode:
            Console.WriteLine($"RMQR Code: {result.Value}");
            break;
        default:
            Console.WriteLine($"Other format ({result.QrType}): {result.Value}");
            break;
    }
}
Imports IronQr
Imports IronQr.Enum
Imports System.Drawing

' Import an image containing QR codes
Dim inputImage As Image = Image.FromFile("sample.jpg")

' Load the asset into a QrImageInput object
Dim imageInput As New QrImageInput(inputImage)

' Create a QR Reader object
Dim reader As New QrReader()

' Read all embedded QR codes from the image
Dim results As IEnumerable(Of QrResult) = reader.Read(imageInput)

' Route processing based on the detected QR code format
For Each result As QrResult In results
    Select Case result.QrType
        Case QrEncoding.QRCode
            Console.WriteLine($"Standard QR Code: {result.Value}")
        Case QrEncoding.MicroQRCode
            Console.WriteLine($"Micro QR Code: {result.Value}")
        Case QrEncoding.RMQRCode
            Console.WriteLine($"RMQR Code: {result.Value}")
        Case Else
            Console.WriteLine($"Other format ({result.QrType}): {result.Value}")
    End Select
Next
$vbLabelText   $csharpLabel

Each case targets a specific QrEncoding value. The default branch catches any format not explicitly handled, so the loop never fails silently on unexpected input. Add more cases as the application needs to support additional formats.

Output

Console output showing format-based routing result for each detected QR code

What Does QrResult.QrType Return?

QrType is a QrEncoding enum property on every QrResult that identifies the symbology detected by the scanner. It is populated automatically during QrReader.Read() and requires no additional configuration. Add using IronQr.Enum; to use QrEncoding values directly in a switch.

Value Description
QrEncoding.QRCode Standard QR code, the most common format used across all industries
QrEncoding.MicroQRCode Compact variant designed for small surfaces with limited print area
QrEncoding.RMQRCode Rectangular Micro QR code optimized for narrow, elongated label shapes (rMQR)

QrType is read-only and reflects what the scanner detected in the image. Its value does not depend on how the QR code was generated.


What Are Common Use Cases for QrType?

  • Logistics and shipping: Detect whether a label carries a standard QR code or a compact Micro QR and route each to the correct parsing pipeline.
  • Document processing: Validate that a scanned document contains the expected format before extracting its value for record matching.
  • Multi-format kiosks: Accept different QR formats at a single station and dispatch each to the appropriate handler without manual intervention.
  • Audit and compliance: Log the symbology type alongside decoded values to create a verifiable record of input formats across batches.
  • Quality assurance: Verify that generated QR codes scan back as the intended type, confirming output matches specification.

For more on reading QR code data after detecting the type, see the Read QR Code Value guide and the full IronQR feature set.

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