We describe a new non-contact high capacity optical tagging technique for bead based assays, based on the use of nanostructured barcodes. The tags are generated from a number of superimposed diffraction gratings. With one-dimensional diffraction, capacity for up to 68,000 distinguishable tags has been demonstrated, with a theoretical capacity of up to 10(9) tags. Extension into two dimensions increases this theoretical limit to 10(21) tags. (C) 2007 Elsevier B.V. All rights reserved.