Heparin is an anticoagulant (blood thinner) that prevents the formation of blood clots. Heparin is used to treat and prevent blood clots in the veins, arteries, or lung. Heparin is also used before surgery to reduce the risk of blood clots. Heparin injection should not be used to flush (clean out) an intravenous (IV) catheter. A separate heparin product is available to use as catheter lock flush. Heparin may also be used for purposes not listed in this medication guide.