Heparin is a family of highly acidic mucopolysaccharides "formed of equal parts of sulfated D-glucosamine and D-glucuronic acid with sulfaminic bridges. The molecular weight ranges from six to twenty thousand. Heparin occurs in and is obtained from liver, lung, mast cells, etc., of vertebrates. Its function is unknown, but it is used to prevent blood clotting in vivo and vitro, in the form of many different salts." 
It is used to flush intravenous catheters; a "heparin lock", consisting of a capped intravenous catheter filled with a heparin solution, may be used to keep an intravenous access without requiring an active fluid drip. Needles for both intravenous administration and venepuncture are often coated internally with heparin ("heparinized").
Venepuncture sample containers for complete blood counts and other hematological tests requiring the preservation of blood cells are color-coded with lavender tops.