Two-dimensional (2D) barcodes ubiquitously used to label, track and authenticate objects face increasing challenges of being damaged, altered and falsified. The past effort in nanomaterials has paved the way for controlled synthesis of nanomaterials with desired size, shape and function. Due to their extremely small sizes, these nanomaterials are promising as next generation barcodes that can be added into or mixed with objects of interest without being noticed. These barcodes can be effectively read owing to their physical properties by manufacturers, law enforcement and security agencies. Meanwhile, nanomaterial-based barcodes are hard to reverse-engineer or imitate without advanced knowledge and technical expertise. This review describes how nanomaterials can be used as barcodes, discusses advantages and limitations of each type of nanomaterial-based barcode, and points out ways that could help design and prepare better nanomaterial-based barcodes.