Black tarry and unformed stool may represent the passage of altered blood - also known as melena.
The most common cause of melena is internal bleeding from peptic ulcers, usually originating from a point higher up in your gastrointestinal (GI) tract like the stomach or duodenum.
Risk factors for peptic ulcer disease include presence of Helicobacter pylori (a bacteria found in the stomach) and consumption of certain medications such as aspirin and non-steroidal anti-inflammatory drugs (NSAIDs).
In contrast, bleeding that originates from the lower GI tract or colon usually manifests as bright red blood or maroon coloured stool. Causes of lower GI bleeding include colonic diverticular disease, colitis (inflammation of the colon) or hemorrhoids (piles).
Other common but less serious causes of black or dark coloured stool include (1) certain foods such as liquorice or blueberries; (2) consumption of iron supplements - however this is usually associated with solid stool as opposed to unformed or watery stool.
As internal bleeding from the GI tract is a medical emergency, I would recommend that you seek urgent medical attention.
If you are indeed experiencing internal bleeding, you will need an urgent endoscopy to locate the bleeding point and stop the bleeding.
In situations like these - it is always better to be safe than sorry!