SourceForge Project Page

QR Code

also known as: ISO/IEC 18004:2006(E)


Example QR Code symbol
Barcode4J does not currently contain an actual QR Code encoder. The QR Code support is currently just an adapter to ZXing's QR encoder. This means that ZXing Core 1.7 (or later) has to be in the classpath for this to work. Barcode4J may get its own QR Code encoder sometime in the future.


The configuration for the default implementation is:

    <module-width>{length:0.352777mm}</module-width> <!-- 1 pixel at 72dpi -->
    <quiet-zone enabled="{boolean:true}">{length:4mw}</quiet-zone>


  • This symbology has no human-readable part!
  • The algorithm always chooses the smallest possible symbol arrangement.
  • By default, the "L" error correction level is used, allowing about 7% of the codewords to be recovered from a damaged symbol. You can set "ec-level" to "M" (15%), "Q" (25%) or "H" (30%) if you have higher reliability requirements (at the expense of symbol size).
  • Features not currently available: Micro QR Code, structured append and min/max size restrictions.

Message format

  • By default, all ISO-8859-1 characters are valid message characters.
  • The "encoding" setting can be used to establish a different ECI (Extended Channel Interpretation) code. By default, messages are encoded in "ISO-8859-1". Only a subset of the encodings defined in Java can be used as they have to be mappable to ECI codes. Besides the "ISO-8859-*" series of encodings, "UTF-8" is probably the most useful encoding. Note that ECI codes may not be supported by every barcode scanner.
  • Using only numeric characters allows for smaller symbol sizes.