Heparin (HEP) is one of the oldest anticoagulant drugs that currently still in widespread clinical use. It lacks chromophore and not easily derivatized due to its hydrophilic nature. In this work we developed a green, selective, and sensitive fluorescence sensor for detection of HEP in its injection dosage forms. The sensor is composed of nitrogen and sulfur co-doped carbon quantum dots (N,S-CDs) semi quenched by Fe3+. The N,S-CDs were prepared using microwave assisted pyrolysis in 3.5 min and exhibited high emission at 425 nm after excitation at 350 nm with high quantum yield of 96%. Owing to the anionic nature of HEP, it could compete with N,S-CDs for Fe3+ complexation resulting in turning-on the quenched fluorescence. This fluorescence enhancement was linear over a concentration range between 6 and 20 μg/mL (R2 = 0.99) with a limit of detection of 1.41 µg/ml. The accuracy and precision of the proposed sensor were indicated by percentage recovery values between 98% −102% and %RSD less than 2, respectively. Furthermore, the proposed sensor was successfully applied for determination of HEP in injection dosage form. The developed sensor showed excellent greenness on analytical eco-scale (score 93%) and GAPI scale.