The diagnosis of bacterial infections remains a major challenge in medicine. Although numerous contrast agents have been developed to image bacteria, their clinical impact has been minimal because they are unable to detect small numbers of bacteria in vivo, and cannot distinguish infections from other pathologies such as cancer and inflammation. Here, we present a family of contrast agents, termed maltodextrin-based imaging probes (MDPs), which can detect bacteria in vivo with a sensitivity two orders of magnitude higher than previously reported, and can detect bacteria using a bacteria-specific mechanism that is independent of host response and secondary pathologies. MDPs are composed of a fluorescent dye conjugated to maltohexaose, and are rapidly internalized through the bacteria-specific maltodextrin transport pathway, endowing the MDPs with a unique combination of high sensitivity and specificity for bacteria. Here, we show that MDPs selectively accumulate within bacteria at millimolar concentrations, and are a thousand-fold more specific for bacteria than mammalian cells. Furthermore, we demonstrate that MDPs can image as few as 10(5) colony-forming units in vivo and can discriminate between active bacteria and inflammation induced by either lipopolysaccharides or metabolically inactive bacteria.