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 CorrectionConfigure the error correction level via QrOptions and generate a resilient QR code.
-
1Install IronQR with NuGet Package Manager
-
2Copy 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");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 generate QR codes with error correction
- Create a
QrOptionsobject with a chosenErrorCorrectionLevel - Generate the QR code using
QrWriter.Write()with those options - Save the QR code as a bitmap with
Save() - Export the bitmap to an image file with
SaveAs()
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.
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")Output

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:
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")Output

Low (~7% Recovery)

Medium (~15% Recovery)

High (~25% Recovery)

Highest (~30% Recovery)
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 is the purpose of QR code error correction levels in IronQR?
QR code error correction levels in IronQR enhance the durability of QR codes, allowing them to remain scannable even when partially damaged. By configuring levels like Low, Medium, Quartile, and High, developers can ensure QR codes withstand different environmental conditions.
How do you set QR code error correction levels using IronQR?
To set QR code error correction levels using IronQR, create a QrOptions object with the desired QrErrorCorrectionLevel and use the QrWriter.Write method along with those options to generate the QR code.
What are the different error correction levels available in IronQR?
IronQR provides four error correction levels: Low (7% recovery), Medium (15% recovery), High (25% recovery), and Highest (30% recovery). Each level offers a trade-off between data capacity and resilience.
Which error correction level should be used for digital displays?
For digital displays, it's recommended to use QrErrorCorrectionLevel.Low, as the environment is controlled and there's no physical wear, enabling the QR code to remain simple and quick to scan.
How does higher error correction impact the QR code's appearance?
Higher error correction levels increase the number of redundancy modules, making the QR code's pattern denser. This can affect scanning speed and the overall size of the QR code image.
Can IronQR handle QR codes in harsh environments?
Yes, IronQR can generate QR codes suitable for harsh environments by setting the error correction level to Highest, which allows for up to 30% recovery of damaged data.
Why is it important to choose the correct error correction level for your use case?
Choosing the correct error correction level ensures that the QR code can survive the specific environmental conditions it will be exposed to, whether it is a clean digital display or an industrial setting with potential damage.
What is the default use case for QrErrorCorrectionLevel.Medium?
QrErrorCorrectionLevel.Medium is best suited for business cards, flyers, and indoor signage, where light handling and minor creasing may occur but won't significantly affect scanning.
How does IronQR help in generating resilient QR codes?
IronQR helps generate resilient QR codes by allowing developers to configure error correction levels that determine the QR code's capacity to recover from damage, enhancing its durability and reliability.
What should developers new to QR code generation start with?
Developers new to QR code generation should start by exploring the 'Create QR Code as Image' guide to understand the basics before delving into configuring error correction levels with IronQR.

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.