An ink sac is an anatomical feature that is found in many cephalopod mollusks used to produce the defensive cephalopod ink. With the exception of nocturnal and very deep water cephalopods, all Coleoidea (squid, octopus and cuttlefish) which dwell in light conditions have an ink sac, which can be used to expel a cloud of dark ink in order to confuse predators.
The ink sac is a muscular bag which originated as an extension of the hind gut; it is a modified hypobranchial gland. It lies beneath the gut and opens into the anus, into which its contents – almost pure melanin – can be squirted; its proximity to the base of the funnel means that the ink can be distributed by ejected water as the cephalopod uses its jet propulsion. The ejected cloud of melanin is bound by mucus particles, so it forms a lump approximately the size and shape of the cephalopod, fixing the predator's attention while the mollusc itself makes a hasty escape.