COMPARE TO OTHER COMPONENTS

A Comparison Between IronBarcode & QrCoder C#

In this tutorial, we will compare two widely used C# libraries - IronBarcode and QrCoder - for working with QR codes and barcodes.

Let's begin with a brief introduction to both libraries:

IronBarcode

IronBarcode is a library created and maintained by Iron Software that enables C# software engineers to read and write barcodes and QR codes in .NET applications and websites. It is available on NuGet for all .NET Frameworks and .NET Core Frameworks. IronBarcode requires only one line of code to read or write barcodes.

QrCoder

QRCoder is a simple C# library that allows you to create QR codes. It has no dependencies on other libraries and is available on NuGet in .NET Framework and .NET Core PCL versions.

Both libraries should have the following main features:

  • Scan QR code
  • Scan barcode
  • Generate QR code
  • Generate barcode

We will implement all of these features from both libraries and compare their performance.

First, let's install both libraries in our Visual Studio project. Since both libraries have their own NuGet packages, we will install them via the NuGet Package Manager Console.

Install IronBarcode

To install IronBarcode, type the following command in the Package Manager Console:

Install-Package BarCode

This will install the IronBarcode library in our project.

A Comparison Between IronBarcode and QrCoder C# - Figure 1: Installing IronBarcode

Installing IronBarcode

Install QrCoder

Type the following command in Package Manager Console:

Install-Package QRCoder

This will install the QrCoder library in our project.

A Comparison Between IronBarcode and QrCoder C# - Figure 2: Installing QrCoder

Installing QrCoder

Now, we will generate our first QR code using both libraries.

Generate QR codes using IronBarcode

The following code will generate a QR code.

using System;
using System.Diagnostics;
using IronBarCode;

class Program
{
    static void Main()
    {
        // Create a stopwatch to measure the execution time
        Stopwatch stopwatch = new Stopwatch();
        stopwatch.Start();

        // Generate a QR code
        var qrCode = QRCodeWriter.CreateQrCode("Iron Barcode Vs QrCoder");

        // Save the generated QR code as a PNG file
        qrCode.SaveAsPng(@"D:\Barcode Images\QrCodeByIronBarcode.png");

        // Stop the stopwatch and output the execution time
        stopwatch.Stop();
        Console.WriteLine($"Execution Time: {stopwatch.ElapsedMilliseconds} ms");
    }
}
using System;
using System.Diagnostics;
using IronBarCode;

class Program
{
    static void Main()
    {
        // Create a stopwatch to measure the execution time
        Stopwatch stopwatch = new Stopwatch();
        stopwatch.Start();

        // Generate a QR code
        var qrCode = QRCodeWriter.CreateQrCode("Iron Barcode Vs QrCoder");

        // Save the generated QR code as a PNG file
        qrCode.SaveAsPng(@"D:\Barcode Images\QrCodeByIronBarcode.png");

        // Stop the stopwatch and output the execution time
        stopwatch.Stop();
        Console.WriteLine($"Execution Time: {stopwatch.ElapsedMilliseconds} ms");
    }
}
Imports System
Imports System.Diagnostics
Imports IronBarCode

Friend Class Program
	Shared Sub Main()
		' Create a stopwatch to measure the execution time
		Dim stopwatch As New Stopwatch()
		stopwatch.Start()

		' Generate a QR code
		Dim qrCode = QRCodeWriter.CreateQrCode("Iron Barcode Vs QrCoder")

		' Save the generated QR code as a PNG file
		qrCode.SaveAsPng("D:\Barcode Images\QrCodeByIronBarcode.png")

		' Stop the stopwatch and output the execution time
		stopwatch.Stop()
		Console.WriteLine($"Execution Time: {stopwatch.ElapsedMilliseconds} ms")
	End Sub
End Class
$vbLabelText   $csharpLabel

The Stopwatch instance is created to measure the execution time of the program to analyze the efficiency of the library.

A Comparison Between IronBarcode and QrCoder C# - Figure 3: IronBarcode Result

Generated Barcode from IronBarcode

IronBarcode's Execution Time

IronBarcode takes 3503 ms to generate and save a QR Code.

A Comparison Between IronBarcode and QrCoder C# - Figure 4: Execution Time

IronBarcode's execution time for generating new Barcodes

Create a QR code with QRCoder

The following sample code will generate a QR code using QrCoder.

using System;
using System.Drawing;
using QRCoder;

class Program
{
    static void Main()
    {
        // Initialize the QRCodeGenerator
        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        // Generate QRCodeData with specified error correction level
        QRCodeData qrCodeData = qrGenerator.CreateQrCode("Iron Barcode Vs QrCoder", QRCodeGenerator.ECCLevel.Q);

        // Create QRCode object
        QRCode qrCode = new QRCode(qrCodeData);

        // Convert QRCode to Bitmap
        Bitmap qrCodeImage = qrCode.GetGraphic(20);

        // Save the QR code as a PNG file
        qrCodeImage.Save(@"D:\Barcode Images\QrCodeByQrCoder.png");
    }
}
using System;
using System.Drawing;
using QRCoder;

class Program
{
    static void Main()
    {
        // Initialize the QRCodeGenerator
        QRCodeGenerator qrGenerator = new QRCodeGenerator();

        // Generate QRCodeData with specified error correction level
        QRCodeData qrCodeData = qrGenerator.CreateQrCode("Iron Barcode Vs QrCoder", QRCodeGenerator.ECCLevel.Q);

        // Create QRCode object
        QRCode qrCode = new QRCode(qrCodeData);

        // Convert QRCode to Bitmap
        Bitmap qrCodeImage = qrCode.GetGraphic(20);

        // Save the QR code as a PNG file
        qrCodeImage.Save(@"D:\Barcode Images\QrCodeByQrCoder.png");
    }
}
Imports System
Imports System.Drawing
Imports QRCoder

Friend Class Program
	Shared Sub Main()
		' Initialize the QRCodeGenerator
		Dim qrGenerator As New QRCodeGenerator()

		' Generate QRCodeData with specified error correction level
		Dim qrCodeData As QRCodeData = qrGenerator.CreateQrCode("Iron Barcode Vs QrCoder", QRCodeGenerator.ECCLevel.Q)

		' Create QRCode object
		Dim qrCode As New QRCode(qrCodeData)

		' Convert QRCode to Bitmap
		Dim qrCodeImage As Bitmap = qrCode.GetGraphic(20)

		' Save the QR code as a PNG file
		qrCodeImage.Save("D:\Barcode Images\QrCodeByQrCoder.png")
	End Sub
End Class
$vbLabelText   $csharpLabel

QrCoder does not provide a built-in function to save the QR code as an image. However, we can save it by parsing the QrCoder into a Bitmap object. We can then save the QR code using the save function provided by Bitmap.

A Comparison Between IronBarcode and QrCoder C# - Figure 5: QR Coder Result

QrCoder's generated barcode

Qrcoder's Execution Time

QrCoder takes 592 ms to generate and save a QR Code.

A Comparison Between IronBarcode and QrCoder C# - Figure 6: QrCoder's Execution Time

The time that it took QrCoder to generate a new barcode

Analysis

The execution time taken by IronBarcode is 3503 ms, while QrCoder only takes 592 ms. This makes QrCoder faster than IronBarcode in terms of performance.

Generating QR codes is much simpler in IronBarcode, as we only need to write two lines of code. With the QrCoder library, it takes five lines of code.

IronBarcode also provides a built-in function to save generated QR codes in a file, while QrCoder does not. We have to create a bitmap object to save the QR code in a file. This requires us to create four objects to generate QR codes using QrCoder. We only need to create one object in IronBarcode to do the same thing.

Next, we will generate barcodes using both libraries.

Generate a Barcode using IronBarcode

The following code will generate a barcode using IronBarcode:

using IronBarCode;

class Program
{
    static void Main()
    {
        // Generate a barcode with Code128 encoding
        var barcode = BarcodeWriter.CreateBarcode("Iron Barcode Vs QrCoder", BarcodeEncoding.Code128);

        // Save the generated barcode as a PNG file
        barcode.SaveAsPng(@"D:\Barcode Images\BarcodeByIronBarcode.png");
    }
}
using IronBarCode;

class Program
{
    static void Main()
    {
        // Generate a barcode with Code128 encoding
        var barcode = BarcodeWriter.CreateBarcode("Iron Barcode Vs QrCoder", BarcodeEncoding.Code128);

        // Save the generated barcode as a PNG file
        barcode.SaveAsPng(@"D:\Barcode Images\BarcodeByIronBarcode.png");
    }
}
Imports IronBarCode

Friend Class Program
	Shared Sub Main()
		' Generate a barcode with Code128 encoding
		Dim barcode = BarcodeWriter.CreateBarcode("Iron Barcode Vs QrCoder", BarcodeEncoding.Code128)

		' Save the generated barcode as a PNG file
		barcode.SaveAsPng("D:\Barcode Images\BarcodeByIronBarcode.png")
	End Sub
End Class
$vbLabelText   $csharpLabel
A Comparison Between IronBarcode and QrCoder C# - Figure 7: Generated barcode using IronBarcode

Generated barcode using IronBarcode

The execution time taken to generate a barcode using IronBarcode is below:

A Comparison Between IronBarcode and QrCoder C# - Figure 8: Execution time for IronBarcode to generate a new Barcode

IronBarcode's Barcode generation time

It takes 3756 ms or 3.76 sec to generate a barcode.

Generate a barcode using QrCoder

It's worth noting that the QrCoder library does not provide the functionality to create barcodes. Therefore, if you need to create barcodes, IronBarcode is the better option.

With regards to QR code scanning, let's see which library is the best option.

Read a QR Code using IronBarcode

The following code will read a QR code using IronBarcode.

using System;
using IronBarCode;

class Program
{
    static void Main()
    {
        // Read QR code from an image file
        BarcodeResults results = BarcodeReader.Read(@"D:\Barcode Images\QrcodeByIronBarcode.png");

        // Check if any QR codes are found
        if (results != null)
        {
            // Loop through each result and print extracted text
            foreach (BarcodeResult result in results)
            {
                Console.WriteLine("Extracted text from QR Code is: " + result.Text);
            }
        }
    }
}
using System;
using IronBarCode;

class Program
{
    static void Main()
    {
        // Read QR code from an image file
        BarcodeResults results = BarcodeReader.Read(@"D:\Barcode Images\QrcodeByIronBarcode.png");

        // Check if any QR codes are found
        if (results != null)
        {
            // Loop through each result and print extracted text
            foreach (BarcodeResult result in results)
            {
                Console.WriteLine("Extracted text from QR Code is: " + result.Text);
            }
        }
    }
}
Imports System
Imports IronBarCode

Friend Class Program
	Shared Sub Main()
		' Read QR code from an image file
		Dim results As BarcodeResults = BarcodeReader.Read("D:\Barcode Images\QrcodeByIronBarcode.png")

		' Check if any QR codes are found
		If results IsNot Nothing Then
			' Loop through each result and print extracted text
			For Each result As BarcodeResult In results
				Console.WriteLine("Extracted text from QR Code is: " & result.Text)
			Next result
		End If
	End Sub
End Class
$vbLabelText   $csharpLabel

IronBarcode returns an Enumerable as a result of reading QR codes. We need to loop through the Enumerable to retrieve each result. This feature is beneficial for reading QR codes from a document or from an image that has more than one QR code.

A Comparison Between IronBarcode and QrCoder C# - Figure 9: IronBarcode's QR Code Scanning Execution Time

The time it takes IronBarcode to read/scan all QR codes from a document

It takes 3136 ms or 3.1 seconds using IronBarcode.

Read a QR Code using QrCoder

The QrCoder Library does not provide the functionality for reading or scanning a QR Code.

Read a Barcode using IronBarcode

The following code will scan the barcode using IronBarcode.

using System;
using IronBarCode;

class Program
{
    static void Main()
    {
        // Read barcode from an image file
        BarcodeResults results = BarcodeReader.Read(@"D:\Barcode Images\BarcodeByIronBarcode.png");

        // Check if any barcodes are found
        if (results != null)
        {
            // Loop through each result and print extracted text
            foreach (BarcodeResult result in results)
            {
                Console.WriteLine("Text Extracted from Barcode is: " + result.Text);
            }
        }
    }
}
using System;
using IronBarCode;

class Program
{
    static void Main()
    {
        // Read barcode from an image file
        BarcodeResults results = BarcodeReader.Read(@"D:\Barcode Images\BarcodeByIronBarcode.png");

        // Check if any barcodes are found
        if (results != null)
        {
            // Loop through each result and print extracted text
            foreach (BarcodeResult result in results)
            {
                Console.WriteLine("Text Extracted from Barcode is: " + result.Text);
            }
        }
    }
}
Imports System
Imports IronBarCode

Friend Class Program
	Shared Sub Main()
		' Read barcode from an image file
		Dim results As BarcodeResults = BarcodeReader.Read("D:\Barcode Images\BarcodeByIronBarcode.png")

		' Check if any barcodes are found
		If results IsNot Nothing Then
			' Loop through each result and print extracted text
			For Each result As BarcodeResult In results
				Console.WriteLine("Text Extracted from Barcode is: " & result.Text)
			Next result
		End If
	End Sub
End Class
$vbLabelText   $csharpLabel

IronBarcode returns Enumerable as a result of reading barcodes. We need to loop through it to get each result. It is beneficial for reading Barcode from a document or image which have more than one barcode.

The output generated by the above code is as:

A Comparison Between IronBarcode and QrCoder C# - Figure 10: Execution time for IronBarcode Scan one or more barcodes

The time IronBarcode takes to scan a barcode contained in a PDF or an image

Read a Barcode using QrCoder

QrCoder Library does not provide the functionality of reading or scanning QR Code.

Now, Let's discuss the license options of both libraries.

Licensing

Licensing for IronBarcode

IronBarcode is free for development. However, It requires a license for deployment outside of the visual studio development environment. License price range from $749 to $2999 (USD). You can get a discount if you purchase the complete Iron Suite.

A Comparison Between IronBarcode and QrCoder C# - Figure 11: Iron Licenses

Check out IronBarcode's [licensing page](/csharp/barcode/licensing/) for more information about available licenses.

Licensing for QrCoder

QrCoder is open source, hence does not require any licensing. You are free to use it in any type of environment. You can also contribute to its source code if you like open-source development.

When to use QrCoder

If we only need the functionality of generating QR codes, QRCoder is the best option to use as it is free to use and doesn't require any payment or subscription fees.

When to use IronBarcode

IronBarcode is a great option when we require functionalities beyond generating QR codes, such as:

  • Reading single or multiple barcodes and QR codes from images or PDFs.
  • Image correction for skewing, orientation, noise, low resolution, contrast, etc.
  • Creating barcodes and applying them to images or PDF documents.
  • Embedding barcodes into HTML documents.
  • Styling barcodes and adding annotation text.
  • QR code writing that allows adding logos, colors, and advanced QR alignment.

Summary

The table below compares both IronBarcode and QrCoder.

A Comparison Between IronBarcode and QrCoder C# - Figure 12: Comparing the two libraries

Side-by-side comparison of IronBarcode and QrCoder

Conclusion

IronBarcode for .NET allows developers to read and write barcodes and QR codes in their .NET applications using just one line of code. The library supports most barcode and QR code standards, including 39/93/128, UPC A/E, EAN 8/13, and QR, among others. The library automatically pre-processes barcode images and offers correction for rotation, noise, distortion, and skewing to improve speed and accuracy. IronBarcode is compatible with 32- and 64-bit systems, all .NET languages, and a variety of platforms, including desktop, console, cloud, and mobile and web applications. It also allows developers to write barcodes and QR codes for PDF, JPG, TIFF, GIF, BMP, PNG, and HTML documents, and modify text color, size, rotation, and quality. The library is secure and does not use web services or send data across the internet. IronBarcode is available for a free trial and offers three licensing options, including a Lite version for individual use, a Professional package for teams of up to 10 developers, and an Unlimited package for companies.

QRCoder is a C# .NET library that generates QR codes based on ISO/IEC 18004 without dependencies on other libraries. It offers several QR code rendering classes, including QRCode, ArtQRCode, AsciiQRCode, and others. However, not all renderers are available on all target frameworks, and the .NET Standard/.NET >=5.0 versions have some constraints. QRCoder is free and does not require licensing.

IronBarcode is more versatile than QrCoder since it offers support for all .NET Framework versions, has a wider range of features, and provides SaaS and OEM Redistribution coverage. IronBarcode also provides comprehensive documentation and 24/7 support, while QRCoder does not. IronBarcode has a licensing fee, but it is reasonable considering the features and support it offers.

IronBarcode is a library developed by Iron Software, which also offers other useful libraries, including IronPDF, IronXL, IronOCR, and IronWebScraper. Purchase the complete Iron Suite to get all five products at a remarkable discount.

In summary, IronBarcode is best suited for those who need to work with both barcodes and QR codes and want to create a barcode generator, QR code generator, barcode reader, and QR code reader. On the other hand, QRCoder is suitable for those who only need to create a QR code generator.

Frequently Asked Questions

What is IronBarcode?

IronBarcode is a library created by Iron Software that enables C# software engineers to read and write barcodes and QR codes in .NET applications and websites. It is available on NuGet for all .NET Frameworks and .NET Core Frameworks.

What is QrCoder?

QrCoder is a simple C# library that allows you to create QR codes. It has no dependencies on other libraries and is available on NuGet in .NET Framework and .NET Core PCL versions.

How do you install IronBarcode?

To install IronBarcode, type 'Install-Package IronBarcode' in the NuGet Package Manager Console.

How do you install QrCoder?

To install QrCoder, type 'Install-Package QRCoder' in the NuGet Package Manager Console.

What are the main features of IronBarcode and QrCoder?

Both libraries offer features such as scanning QR codes, scanning barcodes, generating QR codes, and generating barcodes. However, QrCoder does not support barcode generation.

What is the execution time difference between IronBarcode and QrCoder for generating QR codes?

IronBarcode takes approximately 3503 ms to generate and save a QR Code, while QrCoder takes about 592 ms, making QrCoder faster.

Can QrCoder read or scan QR codes?

No, QrCoder does not provide functionality for reading or scanning QR codes.

Does IronBarcode provide licensing options?

Yes, IronBarcode offers licensing options that include a Lite version for individual use, a Professional package for teams, and an Unlimited package for companies. IronBarcode is free for development but requires a license for deployment outside of the Visual Studio development environment.

Is QrCoder free to use?

Yes, QrCoder is open source and free to use in any type of environment. It does not require any licensing.

When should you use IronBarcode over QrCoder?

IronBarcode is better suited for projects that require functionalities beyond just generating QR codes, such as reading barcodes and QR codes, image correction, styling barcodes, and integrating barcodes into documents. It's ideal for comprehensive barcode and QR code handling.

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 says it’s one of his favorite aspects of working with Iron Software. Jordi grew up in Miami, Florida and studied Computer Science and Statistics at University of Florida.
< PREVIOUS
ZXing.org QR Code Library and IronBarcode: A Comprehensive Comparison
NEXT >
A Comparison Between ZXing Decoder & IronBarcode