Heparin is widely used as an anticoagulant/antithrombotic agent during clinical procedures. Overdosing of heparin can induce significant detrimental effects, such as hemorrhages and thrombocytopenia; therefore, measurement of heparin level in serum during therapy period or within infusion solutions is of vital importance. In this work, we demonstrate a green synthesis of polyethyleneimine (PEI)-stabilized gold nanoparticles (PEI/AuNPs) for highly selective and sensitive colorimetric sensing of heparin. By simply mixing PEI and Au salt in aqueous solution at room temperature, AuNPs with a mean diameter of 4.4nm can be easily formed. The formed positively charged PEI/AuNPs are able to interact with the negatively charged heparin via electrostatic interaction, resulting in the aggregation of AuNPs accompanied by a color change from wine red to light blue in solution. The color change reflected by the variation of the relevant spectroscopic features of AuNPs allows us to establish a simple, visual, and quantitative approach for colorimetric sensing of heparin. We show that the prepared PEI/AuNPs are able to detect the concentration of heparin within a range of 3–11μg/mL, and the method has a high sensitivity with a heparin detection limit of 1.5μg/mL and excellent selectivity in the presence of other biopolymers and small molecules.