QR Code Size Setting Instruction

Generating and Scanning QR Code Barcodes

OnBarcode provides comprehensive QR Code barcode generator and scanner components for Java, .NET, Android, iOS developments and several reporting applications.

QR Code Barcode Generation Controls QR Code Barcode Scanner Controls QR Code Barcode Generator & Reader Software


How to generate, print barcode using .NET, Java sdk library control with example project source code free download:

QR Code Structure

  • W : the width of QR Code image (including quiet zone).
  • H : the height of QR Code image (including quiet zone).
  • X : the width of QR Code module.
  • Q : the width of the quiet zone; Q = 4X.



QR Code Image Size

QR Code image has 40 Versions, ranging from Version 1 to Version 40. So, there are 40 sizes of QR Code in all and the size begins from 21 X 21 modules and up to 177 X 177 modules (not including quiet zone), increasing in steps of 4 modules per side.

  • V : the version of QR Code, ranging from Version 1 to Version 40.


The QR Code barcode width, W (measured in pixel), including quiet zone, can be computed from the following expression:

W = [ 8 * 2 + ( 4V + 1) ] X + 2Q

W is equal to the value of QR Code image height (H).


Then the minimum value of W can be calculated as below:

V min = 1 , X min = 1 , Q = 4X .
W min = [ 8 * 2 + ( 4V + 1 ) ] X + 2Q
           = [ 16 + 5 ] X + 2 * 4X
           = 21X + 8X
           = 29X
           = 29 pixel


So, QR Code image size is determined as long as the image version and module size are determined. The steps below can be used to obtain QR Code version and calculate the image size.

  • Make certain the data to be encoded.
  • Specify the error correction level of QR Code.
  • Refer to QR Code Version and Maximum Data Capacity Table and choose the smallest version that accommodates your input data.
  • Calculate the QR Code image width (W) from the following expression:
W = [ 8 * 2 + ( 4V + 1) ] X + 2Q

W is equal to the value of QR Code image height (H).


For instance, you need to encode 100 numeric characters into a QR Code:

  • Set the error correction level to be "L".
  • In the reference table, the Version 3 with level L is able to encode 100 or more numeric characters (up to 127 characters).
  • Then, the image width including quiet zone should be computed as below:
  • Calculate the QR Code image width (W) from the following expression:
W = [ 8 * 2 + ( 4V + 1) ] X + 2Q       // V = 3
    = [ 16 + 13 ] X + 2Q       // Q = 4X
    = 29X + 2 * 4X
    = 29X + 8X
    = 37X

W min = 37X       // X = 1
           = 37 pixel

H min = 37 pixel


OnBarcode provides details of QR Code Barcode Size Setting in C#.



OnBarcode is a market-leading provider of barcode imaging generator, reader controls and components for ASP.NET, Windows Forms, WPF, as well Java, Android, iOS (iPhone, iPad) across all major enterprise development platforms. We provides comprehensive tutorials and how-tos for various linear, 2d barcode information, such as C# in ASP.NET, C# .NET, C# Barcode Encoding, C# Barcode Image, VB.NET in ASP.NET, VB.NET Winforms, VB.NET Barcode Encoding. OnBarcode barcode products are supported by RasterEdge ASP.NET Document Viewer, which supports ASP.NET PDF Viewer, ASP.NET MVC Document Viewer, ASP.NET PDF Editor, MVC PDF Viewer. And provide high quality C# Convert PDF to Tiff, C# Convert PDF to Word, C# Convert PDF to HTML, C# Convert PDF to Jpeg images, and their easy and simple documents, like C# PDF SDK, C# extract text from PDF, C# Compress PDF, Print PDF in C# and C# extract image from PDF.
Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.