Glossary
CRC16
CRC16 is a family of 16-bit cyclic redundancy checks. EMVCo payment QR payloads, including PIX, end with field 63 carrying a CRC-16/CCITT-FALSE checksum — polynomial 0x1021, initial value 0xFFFF, written as four hex digits — so any hand-edited payload fails validation until the checksum is recomputed.
Where QR codes use it
The QR symbol already protects itself with Reed–Solomon coding,
but that only guarantees the decoded string matches what was encoded. Payment standards
add a second integrity layer inside the payload itself: every
EMVCo merchant-presented payload — PIX, PromptPay,
QRIS and relatives — ends with field 63, a checksum over everything before it,
computed as CRC-16/CCITT-FALSE: polynomial 0x1021, initial value 0xFFFF, no final
XOR, rendered as four uppercase hex digits. UseQR's PIX builder implements exactly this,
and the parameters here are taken from that working code.
...6304ABCD
│ │ └ CRC over the payload up to and including "6304"
│ └ length: 04
└ field ID: 63
Why your edited PIX code stopped working
Change one character of a payload — fix a typo in the merchant name, bump an amount — and the stored CRC no longer matches. Banking apps are required to reject the code, and do, usually with an unhelpful "invalid QR" message. This is the single most common failure when people copy a Copia e Cola string into a generic text generator after tweaking it. The fix is never to edit by hand: rebuild the payload with a proper PIX generator so field 63 is recomputed, then decode and check it. Full field-by-field detail: PIX QR code format and its CRC16 checksum.
FAQ
Why is my edited PIX QR code invalid?
The payload ends in a CRC16 checksum of everything before it. Editing any character without recomputing field 63 makes the checksum wrong, and payment apps reject the code.
Does every QR code have a CRC?
No. The QR symbol itself uses Reed–Solomon, not CRC. A payload-level CRC16 is specific to certain formats — EMVCo payment codes like PIX carry one; a plain URL code has none.
Try it — free, no signup
Related
- EMVCo QR code — EMVCo QR is the international standard for payment QR codes, defining a tag-length-value payload used by PIX in Brazil, PromptPay in Thailand, QRIS in…
- Reed–Solomon coding — Reed–Solomon is the error-correcting code that lets a damaged QR code still decode. It adds redundant codewords so that a decoder can reconstruct the…
- Payload — The payload is the actual string encoded in a QR code — the URL, the WIFI: block, the vCard. Everything about a code's size, density and minimum print…
- Codeword — A codeword is one 8-bit byte in a QR code's data stream. Capacity tables are ultimately expressed in codewords: a version-1 code holds 26 of them, split…