During the last few decades, whole-cell biosensors have attracted increasing attention for their enormous potential in monitoring bioavailable heavy metal contaminations in the ecosystem. Visual and measurable output signals by employing natural pigments have been demonstrated to offer another potential choice to indicate the existence of bioavailable heavy metals in recent years. The biosynthesis of the blue pigment indigoidine has been achieved in E. coli following heterologous expression of both BpsA (a single-module non-ribosomal peptide synthetase) and PcpS (a PPTase to activate apo-BpsA). Moreover, we demonstrated herein the development of the indigoidine-based whole-cell biosensors to detect bioavailable Hg(II) and Pb(II) in water samples by employing metal-responsive transcriptional regulator MerR and PbrR as the sensory elements, and the indigoidine biosynthesis gene cluster as a reporter element. The resulting indigoidine-based biosensors presented a good selectivity and high sensitivity to target metal ions. High concentration of target metal exposure could be clearly recognized by the naked eye due to the color change by the secretion of indigoidine, and quantified by measuring the absorbance of the culture supernatants at 600 nm. Dose-response relationships existed between the exposure concentrations of target heavy metals and the production of indigoidine. Although fairly good linear relationships were obtained in a relatively limited concentration range of the concentrations of heavy metal ions, these findings suggest that genetically controlled indigoidine biosynthesis triggered by the MerR family transcriptional regulator can enable a sensitive, visual, and qualitative whole-cell biosensor for bioindicating the presence of bioaccessible heavy metal in environmental water samples. KEY POINTS: • Biosynthesis pathway of indigoidine reconstructed in a high copy number plasmid in E. coli. • Visual and colorimetric detection of Hg(II) and Pb(II) by manipulation of indigoidine biosynthesis through MerR family metalloregulator. •Enhanced detection sensitivity toward Hg(II) and Pb(II) achieved using novel pigment-based whole-cell biosensors.