Food toxins are produced as defense tools by microorganisms that use nutrients for their growth. Microorganisms thus spoil food, taste and can infect humans, sometimes leading to death. Food adulteration and brand protection are also major issues in the food industry. Here we review the use of nanomaterials for sensing food quality. Nanosensors can detect pathogenic bacteria, food-contaminating toxins, adulterant, vitamins, dyes, fertilizers, pesticides, taste and smell. Food freshness can be monitored using time–temperature and oxygen indicators. Product authenticity and brand protection can be assessed using invisible nanobarcodes. Overall, nanosensors with unique properties are improving food security.