Mercury ions sensing is an important issue for human health and environmental safety. A novel fluorescence nanosensor was designed for rapid visual detection of ultratrace mercury ions (Hg2+) by using CH3NH3PbBr3 perovskite quantum dots (QDs) based on the surface ion-exchange mechanism. The synthesized CH3NH3PbBr3 QDs can emitt intense green fluorescence with high quantum yield of 50.28%, and can be applied for Hg2+ sensing with the detection limit of 0.124 nM (24.87 ppt) in the range of 0 nM–100 nM. Furthermore, the interfering metal ions have no any influence on the fluorescence intensity of QDs, showing the perovskite QDs possess the high selectivity and sensitivity for Hg2+ detection. The sensing mechanism of perovskite QDs for Hg2+ is has also been investigated by XPS, EDX studies, showing Pb2+ on the surface of perovskite QDs has been partially replaced by Hg2+. Spot plate test shows that the perovskite QDs can also be used for visual detection of Hg2+. Our research indicated the perovskite QDs are promising candidates for the visual fluorescence detection of environmental micropollutants.