You are on page 1of 8

QR Code Introduction

This page talks about general information of the 2D barcode, QR Code (ISO/IEC 18004:2006).

Page Content
o o o o o o o o o o o
QR Code Overview QR Code Structure and Size QR Code Data Encoding QR Code Data Characters per Symbol QR Code Error Correction Level QR Code Orientation Independence Generating and Scanning QR Code Barcodes Generating and Printing GS1 Compatible QR Code Encoding ISO-8859-1 Chars and ASCII Control Functions in QR Code Barcodes Encoding Unicode and International Character Sets Encoding Kanji Character Set QR Code Extended Channel Interpretations (ECI) QR Code Structured Append

QR Code Overview

QR Code is a matrix barcode (or two-dimensional code), readable by QR scanners, mobile phones with a camera, and smartphones. It consists of black modules arranged in a square pattern on white background. The information encoded can be text, URL or other data. OnBarcode QR Code Generator Components are fully compatible with ISO/IEC 18004:2006.

QR Code Structure and Size


Each QR Code is a regular square array constructed of several nominally square modules, including an encoding region and function patterns, namely finder, separator, timing patterns, and alignment patterns. Function patterns cannot be used to encode data, and the QR Code symbol is surrounded by quiet zone on all four sides.

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. Please get details from QR Code size setting instruction.

QR Code Data Encoding


QR Code is capable of encoding the following characters:

numeric data (digits 0 - 9); alphanumeric data (digits 0 - 9; upper case letters A - Z; nine other characters: space, $ % * + - . / : ); byte data (default: ISO/IEC 8859-1; or other sets as otherwise defined); Kanji characters. Kanji characters in QR Code 2005 can be compacted into 13 bits.

QR Code Data Characters per Symbol


Maximum QR Code symbol size, in Version 40 and error correction level (L):

numeric data: 7,089 characters alphanumeric data: 4,296 characters Byte data: 2,953 characters Kanji data: 1,817 characters

QR Code Error Correction Level


Even though a QR Code image is partially dirty or damaged, the data encoded can be recovered. And its recovery depends on the amount of dirt or damage. Four levels of Reed-Solomon error correction are available to choose, allowing recovery of:

Level L 7% Level M 15%

Level Q 25% Level H 30% of the QR Code symbol codewords.

QR Code Orientation Independence


QR Code is readable from any direction, both rotation and reflection. The position detection patterns at the three corners of the QR Code image guarantee stable high-speed reading, circumventing the negative effects of background interference.

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 Generator Components

Generating & Printing QR Code Barcodes in ASP.NET, VB.NET, C# Generating & Printing QR Code Barcodes in Java Generating & Printing QR Code Barcodes in iOS (iPhone & iPad) Generating & Printing QR Code Barcodes in Android Generating & Printing QR Code Barcodes in BIRT Reports Generating & Printing QR Code Barcodes in Reporting Service 2005 & 2008 QR Code Scanner Components Reading & Scanning QR Code Barcodes in ASP.NET, VB.NET, C# Reading & Scanning QR Code Barcodes in Java QR Code Generator & Scanner Software QR Code Generator Software Mac OS QR Code Generator Software Free Online QR Code Generator Free QR Code Scanner Software

Generating and Printing GS1 Compatible QR Code with AIs (Application Identifiers)
You can easily generate GS1 compatible QR Code barcodes using the above QR Code Generation Libraries by:

Set FNC1 property value to FNC1_Enable (1).

Set QR Code Data property value with GS1 AI (Application Identifier) codes and datas. Use parentheses to indicate the AI codes.

For example, if you need to encode "Global Trade Item Number (GTIN)" and "Production Date" into a QR Code. You may set the property "Data" value to "(01)01234567891234(11)100130", in which: 1. "01" is Global Trade Item Number (GTIN) AI Code (Application Identifier Code). 2. "01234567891234" is your GTIN AI Data. 3. "11" is Production Date AI Code. 4. 100130" is your Production Date AI Data (produced in Jan 30, 2010).

Encoding ISO-8859-1 Chars and ASCII Control Functions in QR Code Barcodes


QR Code default encoding character set is the ISO 8859-1 standard (the first 128 chars are standard ASCII chars). You can easily encode ISO 8859-1 chars and ASCII control functions into a QR Code symbol. To encode some non-printable ISO-8859-1 chars and ASCII control functions, you need do the following steps using our QR Code Generation Controls.

Set QR Code property DataMode value to Auto (including all ASCII). Set QR Code property ProcessTilde value to True. Use tilde "~ddd" (ddd is from 000 to 255 for 256 ISO-8859-1 (Latin 1)) to encode chars and control functions.

For example, if you want to encode value "QR<carriage return>Code", you should set QR Code property Data value to "QR~013Code", in which: 1. "013" represents the carriage return.

Encoding Unicode and International Character Sets


Instead of encoding ISO 8859-1 standard chars, QR Code allows you to switch to other encoding characters (e.g. Arabic, Cyrillic, Greek, Hebrew) through ECI (Extended Channel Interpretations). To encode Unicode and International Character Sets, you are supposed to do the following steps using our QR Code Generation Components.

Set QR Code property DataMode value to Auto (including all ASCII). Set QR Code property ProcessTilde value to True. Use tilde "~6dddddd" (dddddd is from 00000 ~ 65535) for 2-byte chars.

You need to use ECI to switch to your encoding character set, the default character set in QR Code is ISO 8859-1 (ECI value is 000003).

QR Code Encoding Kanji Character Set

The QR-Code Kanji mode efficiently encodes Kanji characters in accordance with the Shift JIS system based on JIS X 0208. The Shift JIS values are shifted from the JIS X 0208 values. JIS X 0208 gives details of the shift coded representation. Each two-byte character value is compacted to a 13-bit binary codeword. To encode Kanji Character Set (Shift JIS), you need do the following steps using our QR Code Generation Components.

Set QR Code property DataMode value to Kanji. Set QR Code property ProcessTilde value to True. Use tilde "~9ddddd" ((Shift JIS 0x8140 ~ 0x9FFC and 0xE040 ~ 0xEBBF)) for 2-byte chars.

QR Code Extended Channel Interpretations (ECIs)


ECI enables QR Code encode multiple character sets (e.g. Arabic, Cyrillic, Greek, Hebrew) and other data interpretations or industry specific requirements to be represented, into one QR Code symbol. The ECI is identified by a 6-digit number which is encoded in the QR Code symbol by the ECI character followed by one to three codewords. The default ECI is the ECI 000003 which describes the Latin alphabet according to the ISO 8859-1 standard (standard ASCII table). International applications using other character sets should use the ECI protocol. For instance, the interpretation corresponding to the JIS8 and Shift JIS character sets is ECI 000020. (To encode kanji code, we recommend you apply Kanji Mode in QR Code) You can have multiple ECIs (to encode multiple character sets) in your single QR Code symbol. To encode ECIs in QR Code symbol, you should do the following steps using OnBarcode's QR Code Generation Libraries.

Set QR Code property ProcessTilde value to True. Insert ECI "~7dddddd" into your QR Code encoding data, to switch to another character set, and followed by your new character set data.

QR Code Structured Append


You can append up to 16 QR Code 2005 symbols in a structured format. To encode Structured Append in QR Code symbols, you need do the following steps using OnBarcode's QR Code Generation Controls.

Set QR Code property StructuredAppend value to True. Set QR Code property SymbolCount value to the count of QR Code Structured Append symbols. Set QR Code property SymbolIndex value to indicate the position of the QR Code symbol in the same group of all Structured Append symbols. Starting with 1. Set QR Code property Parity value to be identified to the same group of QR Code Structured Append symbols. Starting with 1.

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

Easily generate QR Code in ASP.NET, VB.NET, C#.NET projects Simply create QR Code in Java projects Easy to encode, create QR Code in iOS (iPhone & iPad) projects Simple to produce, generate QR Code in Android projects Easy to generate, encode QR Code in BIRT Reports Simple to encode, produce QR Code in Reporting Service QR Code Barcode Scanner Controls Easily read, scan QR Code images in ASP.NET, VB.NET, C# Easily recognize, scan QR Code images in Java applications QR Code Barcode Generator & Reader Software Windows QR Code Generator Software Mac OS QR Code Barcode Generator Software Free Online QR Code Barcode Generator Free QR Code Barcode Scanner Software

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#.

You might also like