How to Set QR Code Error Correction Levels

Take control of performance. Adjust error correction settings to create faster, more durable QR codes that can withstand damage and still scan reliably.

Error correction is what separates a QR code that falls apart from one that keeps working. When a printed label gets scratched, a sticker peels, or a poster fades in the sun, error correction determines whether the code still scans. IronQR allows developers to choose exactly how much resilience a QR code carries, from lightweight codes optimized for clean digital displays to heavy-duty codes built to survive warehouses and factory floors.

This guide demonstrates how to configure error correction levels using the IronQR library, balancing data density against damage tolerance for any use case. Developers new to generating QR codes should start with the Create QR Code as Image guide first.

Quickstart: Set QR Code Error Correction

Configure the error correction level via QrOptions and generate a resilient QR code.

  1. Install IronQR with NuGet Package Manager

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

    var options = new QrOptions(QrErrorCorrectionLevel.Medium);
    var qrCode = QrWriter.Write("https://example.com", options);
    qrCode.Save().SaveAs("qr-medium.png");
  3. Deploy to test on your live environment

    Start using IronQR in your project today with a free trial

    arrow pointer

Understanding Error Correction Levels

QR codes use Reed-Solomon error correction to remain scannable even when partially damaged or obscured. The QrErrorCorrectionLevel enum in IronQR provides four levels, each trading data capacity for increased resilience:

Level Recovery Capacity Best For
QrErrorCorrectionLevel.Low ~7% damage Digital screens, controlled environments
QrErrorCorrectionLevel.Medium ~15% damage General-purpose use, moderate durability
QrErrorCorrectionLevel.High ~25% damage Printed materials, outdoor signage
QrErrorCorrectionLevel.Highest ~30% damage Industrial labels, harsh conditions

Higher error correction adds more redundancy modules, which increases the QR code's visual density. This also affects the size of the generated image, so developers may need to adjust dimensions accordingly. The lowest level that meets durability requirements keeps the code compact and fast to scan.

Setting Error Correction Level

To set the error correction level, pass the desired QrErrorCorrectionLevel value to the QrOptions constructor. Then pass these options to QrWriter.Write() when generating the QR code.

In this example, the error correction is set to Medium, which recovers up to 15% of damaged data while keeping the code compact.

:path=/static-assets/qr/content-code-examples/how-to/error-correction-qr-code.cs
using IronQr;
using IronSoftware.Drawing;

QrOptions options = new QrOptions(QrErrorCorrectionLevel.Medium);

// Create QR code
QrCode qr = QrWriter.Write("1234", options);

// Save QR code as a bitmap
AnyBitmap qrImage = qr.Save();

// Save QR code bitmap as file
qrImage.SaveAs("qrMedium.png");
Imports IronQr
Imports IronSoftware.Drawing

Dim options As New QrOptions(QrErrorCorrectionLevel.Medium)

' Create QR code
Dim qr As QrCode = QrWriter.Write("1234", options)

' Save QR code as a bitmap
Dim qrImage As AnyBitmap = qr.Save()

' Save QR code bitmap as file
qrImage.SaveAs("qrMedium.png")
$vbLabelText   $csharpLabel

Output

QR Code with Medium Error Correction

Comparing Error Correction Levels

Each level produces a visually different QR code. Lower levels generate simpler patterns that scan faster, while higher levels create denser patterns that survive more damage. Here's how to generate the same data at each level for comparison:

:path=/static-assets/qr/content-code-examples/how-to/error-correction-qr-code-compare.cs
using IronQr;
using IronSoftware.Drawing;

string data = "https://ironsoftware.com";

// Low - ~7% recovery, smallest code
QrCode qrLow = QrWriter.Write(data, new QrOptions(QrErrorCorrectionLevel.Low));
qrLow.Save().SaveAs("qrLow.png");

// Medium - ~15% recovery, balanced
QrCode qrMedium = QrWriter.Write(data, new QrOptions(QrErrorCorrectionLevel.Medium));
qrMedium.Save().SaveAs("qrMedium.png");

// High - ~25% recovery, durable
QrCode qrHigh = QrWriter.Write(data, new QrOptions(QrErrorCorrectionLevel.High));
qrHigh.Save().SaveAs("qrHigh.png");

// Highest - ~30% recovery, maximum resilience
QrCode qrHighest = QrWriter.Write(data, new QrOptions(QrErrorCorrectionLevel.Highest));
qrHighest.Save().SaveAs("qrHighest.png");
Imports IronQr
Imports IronSoftware.Drawing

Dim data As String = "https://ironsoftware.com"

' Low - ~7% recovery, smallest code
Dim qrLow As QrCode = QrWriter.Write(data, New QrOptions(QrErrorCorrectionLevel.Low))
qrLow.Save().SaveAs("qrLow.png")

' Medium - ~15% recovery, balanced
Dim qrMedium As QrCode = QrWriter.Write(data, New QrOptions(QrErrorCorrectionLevel.Medium))
qrMedium.Save().SaveAs("qrMedium.png")

' High - ~25% recovery, durable
Dim qrHigh As QrCode = QrWriter.Write(data, New QrOptions(QrErrorCorrectionLevel.High))
qrHigh.Save().SaveAs("qrHigh.png")

' Highest - ~30% recovery, maximum resilience
Dim qrHighest As QrCode = QrWriter.Write(data, New QrOptions(QrErrorCorrectionLevel.Highest))
qrHighest.Save().SaveAs("qrHighest.png")
$vbLabelText   $csharpLabel

Please noteHigher error correction levels increase the number of modules in the QR code, which makes the pattern denser. If scanning speed is a priority, the lowest level that meets the project's durability needs is recommended.

Output

QR Code with Low Error Correction
QR Code with Medium Error Correction
QR Code with High Error Correction
QR Code with Highest Error Correction

Choosing the Right Level for the Use Case

The right error correction level depends on where the QR code will live and what it needs to survive:

Use Case Level Why Related Guide
Digital displays and websites QrErrorCorrectionLevel.Low Screen is clean, lighting is controlled, no physical wear. Keeps the code simple and quick to scan. Create QR Code as Image
Business cards, flyers, and indoor signage QrErrorCorrectionLevel.Medium Light handling and minor creasing won't affect scanning. Pair with proper margins for best results. Add Margins to QR Code
Product packaging and outdoor posters QrErrorCorrectionLevel.High Materials face rain, UV exposure, and rough handling during shipping. Scale up size for distance scanning. Resize QR Code
Warehouse labels, factory floors, and industrial tags QrErrorCorrectionLevel.Highest Harsh environments where codes get scratched, stained, or partially covered. Maximum redundancy keeps them working. Read QR Codes from Image

For more advanced QR code generation patterns, explore the C# QR Code Generator tutorial and the full IronQR feature set.

Frequently Asked Questions

What are the QR Code error correction levels available in IronQR?

IronQR offers four QR Code error correction levels: Low, Medium, Quartile, and High. These levels help maintain the scannability of QR codes even when they are partially damaged.

How can I set the error correction level for a QR code using IronQR in C#?

You can set the error correction level in IronQR by configuring the QrErrorCorrectionLevel property in the QrOptions class. Use the QrWriter.Write method to generate the QR code with the specified error correction level.

Why is error correction important for QR codes?

Error correction is crucial for QR codes as it ensures they remain scannable even if they are partially damaged or obscured. IronQR allows you to select different levels of error correction to suit your needs.

Can IronQR handle QR code generation with custom error correction settings?

Yes, IronQR allows you to customize the error correction settings for your QR codes, enabling you to balance between data capacity and robustness against damage.

What is the default error correction level in IronQR?

IronQR typically defaults to a Medium error correction level, which offers a balanced approach between data capacity and error resistance, but you can customize it as needed.

Is it possible to change the error correction level of an existing QR code using IronQR?

To change the error correction level, you need to regenerate the QR code with the desired error correction level using IronQR's QrOptions and QrWriter classes.

How does a higher error correction level affect QR code size?

Increasing the error correction level generally results in larger QR codes because there is more redundant data included to improve damage recovery, which is managed effectively by IronQR.

What scenarios might require a high error correction level in QR codes?

High error correction levels are beneficial in environments where QR codes are likely to suffer damage, such as industrial settings or outdoor locations, ensuring data remains accessible. IronQR provides flexibility by allowing you to set this level.

Does using IronQR require advanced programming skills to set error correction levels?

No, IronQR is designed to be user-friendly, allowing even beginners to easily set QR code error correction levels using straightforward C# code.

Can IronQR be used to generate QR codes for business applications with specific error correction needs?

Yes, IronQR is ideal for business applications as it provides customizable error correction levels, ensuring QR codes can withstand various conditions while maintaining data integrity.

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 66,059 | Version: 2026.5 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package IronQR
run a sample watch your URL become a QR code.