Skip to footer content
USING IRONQR

QR Code Generator .NET Core: Read and Generate QR Codes with Just a Few Lines of Code

If you're building any modern web or enterprise solution on .NET Core, you'll find that handling QR codes, for inventory, payment, or authentication, is often a core requirement. You don't want to spend your time wrestling with complex code; you want a fast, reliable library that just works. IronQR provides a powerful, all-in-one QR code generator .NET Core solution. It manages everything from basic QR creation to advanced features like high error correction and custom images, helping you accelerate development.

Ready to simplify your QR code operations? Start your free trial today and see how easy it is.

NuGet Install with NuGet

PM >  Install-Package IronQR

Check out IronQR on NuGet for quick installation. With over 10 million downloads, it’s transforming PDF development with C#. You can also download the DLL.

How Do I Install the QR Code Library?

Installing IronQR through the NuGet Package Manager is a simple operation that takes seconds. Open Visual Studio, navigate to Tools > NuGet Package Manager, and search for "IronQR." Click the install button to add the NuGet package to your project. The library has minimal NuGet dependencies and supports multi-platform projects on Windows, macOS, and Linux.

Install-Package IronQR

IronQR is .NET implementation compatible with .NET Core 6, 7, 8, and 9, as well as .NET Framework 4.6.2+. For multi-platform projects, SkiaSharp integration enables cross-platform image processing. The library supports ASP.NET Core web applications, console apps, and desktop solutions without additional configuration. Once installed, the source code automatically includes all necessary extension methods for QR operations.

How Can I Read a Basic QR Code from an Image?

Reading QR code data from PNG images or other formats requires just a few lines of code. The QrReader class uses an advanced machine learning QR code model that automatically evaluates image quality and applies optimal segment mode detection for accurate decoding.

using IronQr;
using IronSoftware.Drawing;
namespace Examples
{
    class Program
    {
        static void Main(string[] args)
        {
            // Load image containing QR code
            var inputBmp = AnyBitmap.FromFile("qr-sample.png");
            // Create QrImageInput from the bitmap
            QrImageInput imageInput = new QrImageInput(inputBmp);
            // Initialize QR Reader with ML model
            QrReader reader = new QrReader();
            // Read and decode all QR codes in the image
            IEnumerable<QrResult> results = reader.Read(imageInput);
            // Output decoded text strings
            foreach (var qrCode in results)
            {
                Console.WriteLine($"QR Code Value: {qrCode.Value}");
                Console.WriteLine($"URL: {qrCode.Url}");
            }
        }
    }
}
using IronQr;
using IronSoftware.Drawing;
namespace Examples
{
    class Program
    {
        static void Main(string[] args)
        {
            // Load image containing QR code
            var inputBmp = AnyBitmap.FromFile("qr-sample.png");
            // Create QrImageInput from the bitmap
            QrImageInput imageInput = new QrImageInput(inputBmp);
            // Initialize QR Reader with ML model
            QrReader reader = new QrReader();
            // Read and decode all QR codes in the image
            IEnumerable<QrResult> results = reader.Read(imageInput);
            // Output decoded text strings
            foreach (var qrCode in results)
            {
                Console.WriteLine($"QR Code Value: {qrCode.Value}");
                Console.WriteLine($"URL: {qrCode.Url}");
            }
        }
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Input QR Code

QR Code Generator .NET Core: Read and Generate QR Codes with Just a Few Lines of Code: Image 1 - Input QR Code

Output

QR Code Generator .NET Core: Read and Generate QR Codes with Just a Few Lines of Code: Image 2 - Example QR Code scan output

The QrReader.Read() method processes the input text from QR symbols and returns results containing the decoded data. IronQR supports encoding various data types, including URLs, phone numbers, and text strings. The library can process byte arrays directly or load from extension file paths, making integration flexible for any project architecture.

How Do I Extract Advanced QR Code Data?

Beyond basic QR code reading, IronQR exposes coordinates, raw modules, and structured data segments from each scanned code. This proves essential for applications requiring precise QR symbol positioning or processing multiple codes simultaneously.

using IronQr;
using IronSoftware.Drawing;
namespace Examples
{
    class AdvancedReader
    {
        static void Main(string[] args)
        {
            var inputBmp = AnyBitmap.FromFile("document-with-qr.png");
            QrImageInput imageInput = new QrImageInput(inputBmp);
            QrReader reader = new QrReader();
            IEnumerable<QrResult> results = reader.Read(imageInput);
            foreach (var qrCode in results)
            {
                // Access QR code data and URL
                Console.WriteLine($"Data: {qrCode.Value}");
                // Get coordinate positions (int x, int y)
                foreach (PointF point in qrCode.Points)
                {
                    Console.WriteLine($"Position: {point.X}, {point.Y}");
                }
            }
        }
    }
}
using IronQr;
using IronSoftware.Drawing;
namespace Examples
{
    class AdvancedReader
    {
        static void Main(string[] args)
        {
            var inputBmp = AnyBitmap.FromFile("document-with-qr.png");
            QrImageInput imageInput = new QrImageInput(inputBmp);
            QrReader reader = new QrReader();
            IEnumerable<QrResult> results = reader.Read(imageInput);
            foreach (var qrCode in results)
            {
                // Access QR code data and URL
                Console.WriteLine($"Data: {qrCode.Value}");
                // Get coordinate positions (int x, int y)
                foreach (PointF point in qrCode.Points)
                {
                    Console.WriteLine($"Position: {point.X}, {point.Y}");
                }
            }
        }
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Input QR

QR Code Generator .NET Core: Read and Generate QR Codes with Just a Few Lines of Code: Image 3 - Input QR code

Advanced QR Read Results

QR Code Generator .NET Core: Read and Generate QR Codes with Just a Few Lines of Code: Image 4 - Results for advanced QR data extraction

The QrResult object provides access to data segments, location coordinates, and decoded values. This enables overlay generation, document processing workflows, and layout-sensitive applications. IronQR can process custom images with logos, damaged codes, or low-resolution inputs thanks to its ML-powered detection.

How Does Error Correction Level Affect QR Code Reading?

Error correction is fundamental to QR code reliability. IronQR supports all standard error correction levels (L, M, Q, H), with higher levels allowing greater data recovery from damaged or obscured codes. The maximum version number allowed determines capacity; version 40 QR codes store up to 7,089 numeric characters.

When generating QR codes, specifying the error correction level ensures the output withstands real-world scanning conditions:

using IronQr;
using IronSoftware.Drawing;
// Configure QR options with high error correction
var qrOptions = new QrOptions(QrErrorCorrectionLevel.High, 20);
// Generate a QR code with specified error correction
QrCode myQr = QrWriter.Write("https://ironsoftware.com", qrOptions);
// Save as PNG image
AnyBitmap qrImage = myQr.Save();
qrImage.SaveAs("high-error-correction-qr.png");
using IronQr;
using IronSoftware.Drawing;
// Configure QR options with high error correction
var qrOptions = new QrOptions(QrErrorCorrectionLevel.High, 20);
// Generate a QR code with specified error correction
QrCode myQr = QrWriter.Write("https://ironsoftware.com", qrOptions);
// Save as PNG image
AnyBitmap qrImage = myQr.Save();
qrImage.SaveAs("high-error-correction-qr.png");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

QR Code Generator .NET Core: Read and Generate QR Codes with Just a Few Lines of Code: Image 5 - Generated QR Code with high error correction level

The error correction level also impacts whether you can add ECI segments or logo images while maintaining scannability. Higher error correction enables adding custom colors and branding without sacrificing reliability.

How Can I Generate QR Codes with International Characters?

IronQR supports encoding that encodes Japanese Unicode text through Kanji mode, making it ideal for international applications. The library automatically selects optimal segment mode for mixed numeric, alphanumeric, or Unicode content. You can also configure data segments manually or add ECI segments for specific character sets.

using IronQr;
using IronSoftware.Drawing;
// Generate QR that encodes Japanese Unicode text
QrCode japaneseQr = QrWriter.Write("こんにちは世界");
// The library handles kanji mode automatically
AnyBitmap qrImage = japaneseQr.Save();
qrImage.SaveAs("japanese-qr.png");
using IronQr;
using IronSoftware.Drawing;
// Generate QR that encodes Japanese Unicode text
QrCode japaneseQr = QrWriter.Write("こんにちは世界");
// The library handles kanji mode automatically
AnyBitmap qrImage = japaneseQr.Save();
qrImage.SaveAs("japanese-qr.png");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

QR Code Output

QR Code Generator .NET Core: Read and Generate QR Codes with Just a Few Lines of Code: Image 6 - Output QR Code

This automatic encoding detection eliminates manual parameters for character set configuration. The QR code generation process handles Japanese Unicode text seamlessly, supporting full Unicode ranges including Kanji mode characters.

How Do I Use Payload Generators for Structured Data?

IronQR supports payload generators that create properly formatted QR code data for common use cases like WiFi credentials, contact information, and calendar events. This simplifies creating QR codes with structured information rather than plain text.

using IronQr;
using IronSoftware.Drawing;
// Generate QR code with URL payload
var urlQrCode = QrWriter.Write("https://ironsoftware.com/csharp/qr/");
// Save QR as PNG image file
AnyBitmap qrImage = urlQrCode.Save();
qrImage.SaveAs("url-qr-code.png");
Console.WriteLine("QR code generated successfully!");
using IronQr;
using IronSoftware.Drawing;
// Generate QR code with URL payload
var urlQrCode = QrWriter.Write("https://ironsoftware.com/csharp/qr/");
// Save QR as PNG image file
AnyBitmap qrImage = urlQrCode.Save();
qrImage.SaveAs("url-qr-code.png");
Console.WriteLine("QR code generated successfully!");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Created QR Code

QR Code Generator .NET Core: Read and Generate QR Codes with Just a Few Lines of Code: Image 7 - QR Code created from an URL

The code generator handles generating PNG images with configurable dimensions. QRCoder library offers similar functionality as a .NET open source library with a permissive MIT license, though IronQR provides enhanced ML-based reading capabilities and commercial support.

Conclusion

IronQR isn't just for reading perfect static images; it shines when you need to scan blurry or damaged codes in real-world environments. The library's support for optional advanced features such as mask pattern configuration, custom styling, and international character encoding makes it suitable for enterprise applications that require reliability and flexibility.

From generating QR codes to reading complex QR symbols from various image formats, IronQR handles the complete workflow with minimal code. The straightforward API documentation and extensive tutorials help developers quickly implement QR functionality.

Purchase an IronQR license to unlock full capabilities for production deployment, or explore additional code examples to see the library in action.

Frequently Asked Questions

What is IronQR?

IronQR is a comprehensive library for handling QR codes in .NET Core. It simplifies the process of reading and generating QR codes with features like ML-powered detection, high error correction, and cross-platform support.

How can IronQR help in my .NET Core projects?

IronQR aids your .NET Core projects by offering a fast and reliable solution for QR code generation and reading, saving you the hassle of complex coding. It manages everything from basic QR creation to advanced features.

What are the advanced features of IronQR?

IronQR includes advanced features such as high error correction levels, ML-powered detection, and support for custom images, which can significantly enhance your application's QR code capabilities.

Is IronQR compatible with cross-platform development?

Yes, IronQR is designed with cross-platform support, making it ideal for modern web and enterprise solutions built on .NET Core.

Can IronQR handle custom QR code images?

Absolutely, IronQR allows the integration of custom images into QR codes, providing flexibility for branding and personalization in your applications.

How does IronQR improve the QR code reading process?

IronQR enhances the QR code reading process through its ML-powered detection, which ensures accurate and quick scanning even in challenging conditions.

Does IronQR support high error correction for QR codes?

Yes, IronQR supports high error correction, which allows QR codes to be scanned correctly even if they are partially damaged or obscured.

Is IronQR easy to integrate into existing .NET Core applications?

IronQR is designed for easy integration into any .NET Core application, providing a seamless experience to add QR code functionalities without extensive refactoring.

Jordi Bardia
Software Engineer
Jordi is most proficient in Python, C# and C++, when he isn’t leveraging his skills at Iron Software; he’s game programming. Sharing responsibilities for product testing, product development and research, Jordi adds immense value to continual product improvement. The varied experience keeps him challenged and engaged, and he ...
Read More