A rapid and highly sensitive photoelectrochemical (PEC) method has been proposed for the determination of trace amounts of chromium in water samples under visible-light irradiation. Here, a unique nanostructured hybrid of formate anion incorporated graphitic carbon nitride (F-g-C3N4) is smartly integrated with a Cr(VI) ion-imprinted polymer (IIP) as a photoactive electrode (denoted as IIP@F-g-C3N4). The nanohybrid of F-g-C3N4 exhibits an enhanced charge separation with substantially improved PEC responses versus g-C3N4. The newly designed IIP@F-g-C3N4 PEC sensor exhibits high sensitivity and selectivity for the determination of Cr(VI) because it offers efficient photogenerated electron reduction toward Cr(VI). The PEC analysis is highly linear over Cr(VI) concentrations ranging from 0.01 to 100.00ppb with a detection limit of 0.006ppb (S/N=3). Our approach can be used to detect Cr(VI), Cr(III) and the total chromium level in aqueous solution through oxidation of Cr(III) to Cr(VI) and the determination of the total chromium as Cr(VI). In practical applications, this low-cost and sensitive assay has been successfully applied for speciation determination of chromium in environmental water samples.