Magnetic barcodes containing 32 composite element bits have been produced and measured in order to optimize the design of magnetic microcarriers. Focused magneto-optic Kerr effect measurements allow the determination of the change in magnetic hysteresis when the width of magnetic elements is varied between bits, and the electron beam lithography used in production is confirmed to be accurate to ∼6 nm using scanning electron microscopy. The sharp magnetic switching observed, an important prerequisite for a functioning device, is attributed to the expected dipolar interactions between magnetic elements and the use of magnetically soft Permalloy. A crossover between two magnetic reversal behaviors is discovered when the magnetic elements are ∼200 nm wide. From these measurements, 12 bits were selected on which data can be written with a low probability of error, with the prospect of the other 20 bits being employed for error correction. We have therefore developed a nonvolatile magnetic memory on which 4096 unique codes can be programmed.