Heparin, also known as unfractionated heparin (UFH), is a medication which is used as an anticoagulant (blood thinner). Specifically it is used to treat and prevent deep vein thrombosis, pulmonary embolism, and arterial thromboembolism. It is also used in the treatment of heart attacks and unstable angina. It is given by injection into a vein or under the skin. Other uses include inside test tubes and kidney dialysis machines.