What's the Difference Between Heparin and Warfarin?

While heparin and warfarin are both anticoagulants, heparin provides an immediate response, while warfarin is generally used for long-term treatment, according to Johns Hopkins Medicine. Heparin is an injection, while warfarin is an oral medication. The two medications also differ in the mechanism by which they work.