Encoding and version stepping
The payload is packed into the QR grid at the smallest version that fits the chosen error correction level. Version 1 is 21x21 modules; each higher version adds 4 modules per side and more capacity. Levels L, M, Q, and H restore roughly 7, 15, 25, and 30 percent of a damaged code respectively, so H gives the most slack for a center logo, at the cost of capacity.