Why does a QR code with an Arabic sentence come out denser than the same sentence in English?

Because the code stores bytes, not letters. In UTF-8 an Arabic letter takes two bytes and an emoji four, while an English letter takes one. So an Arabic sentence needs more bytes, and the code comes out with more, smaller modules at the same printed size.

Published · 2 min read

Two thank-you card sentences compared

We typed a thank-you line for a parcel insert into the QR code generator, in Arabic and then in English, and looked at the byte counter and at the symbol size the library built:

  • The Arabic line (thanks for ordering from Al Waha, we hope you like the product): 54 characters, 99 bytes, and a symbol 41 modules wide.
  • Thank you for ordering from Al Waha, we hope you love it: 56 characters, 56 bytes, and a symbol 33 modules wide.
  • The same Arabic line with a smiling face at the end: 104 bytes. The emoji alone added 4 bytes for a single character.

The two sentences have almost the same number of characters, but the Arabic one needed close to twice the bytes, because its spaces and commas are one byte each and its letters two. The result is eight extra modules per side. With very short phrases you may see no difference: 'Ramadan Kareem from Al Waha' in Arabic takes 37 bytes against 27 in English, and both symbols come out the same width, 29 modules.

When the difference matters

  • When the code is printed small, on a product label or a card, where every extra module shrinks the squares.
  • When the text is long, such as usage instructions, so you approach the capacity limit much sooner than the character count suggests.
  • When you raise the error correction level, because capacity falls and density rises together.

Cutting density without giving up Arabic

  1. Shorten the sentence. Drop words that add no meaning, and use the Word and character counter if you want the byte count before pasting.
  2. Avoid emoji inside the code, at four bytes each.
  3. If the text really is long, put it on a page on your site and let the code carry its short link.
  4. Watch the 'Size: ... bytes of ...' line under the code; it shows the real UTF-8 figure.

Common questions

Is an Arabic code less reliable to scan?

Not because of the encoding. The tool is tested by reading back the downloaded file and matching the Arabic text character for character. The only difference is density, which is a matter of size and print quality.

Do Arabic diacritics add bytes?

Yes. Each diacritic is a separate character in the encoding and takes two bytes, so remove them from the text unless they are needed.