A method of encoding a microarray, wherein the method comprises: a) depositing at least one batch of particles on a substrate to form a microarray, wherein each batch of particles comprises at least two sub-batches of particles and wherein in case more than one batch of particles is deposited each batch of particles is deposited separately and an image is taken of each batch of particles on the microarray after deposition to identify the position of the particles of each batch on the microarray, wherein (i) the number of particles of each sub-batch is unique to that sub-batch of particles resulting in a unique particle number ratio for the one batch; and (ii) in case at least two batches of particles are deposited the particle number ratio for each batch is either the same or different from each other; wherein each sub-batch of particles deposited on the substrate that forms the microarray is capable of binding to a specific target-analyte, wherein each sub-batch of a batch binds to a different target-analyte compared to all other sub-batches of the respective batch; and b) recording information about the position of particles of the batch(es) and information of the particle number ratio for the batch(es) obtained under a) for each microarray produced according to this method; wherein the position of the particles and the particle number ratio within a batch allows determining which target analyte is present in a test sample to be analyzed with the microarray or in case only one batch is deposited the particle number ratio of the batch allows determining which target analyte is present in a test sample to be analyzed with the microarray. a) depositing at least one batch of particles on a substrate to form a microarray, wherein each batch of particles comprises at least two sub-batches of particles and wherein in case more than one batch of particles is deposited each batch of particles is deposited separately and an image is taken of each batch of particles on the microarray after deposition to identify the position of the particles of each batch on the microarray, wherein (i) the number of particles of each sub-batch is unique to that sub-batch of particles resulting in a unique particle number ratio for the one batch; and (ii) in case at least two batches of particles are deposited the particle number ratio for each batch is either the same or different from each other; wherein each sub-batch of particles deposited on the substrate that forms the microarray is capable of binding to a specific target-analyte, wherein each sub-batch of a batch binds to a different target-analyte compared to all other sub-batches of the respective batch; and (i) the number of particles of each sub-batch is unique to that sub-batch of particles resulting in a unique particle number ratio for the one batch; and (ii) in case at least two batches of particles are deposited the particle number ratio for each batch is either the same or different from each other; b) recording information about the position of particles of the batch(es) and information of the particle number ratio for the batch(es) obtained under a) for each microarray produced according to this method;