The short answer is yes, whales do indeed fart, flatus or pass gas depending on how you like to phrase it.
In fact whales, dolphins and porpoises are all marine mammals belonging to the cetacean species and they are all known to fart.
Today there are around 80 – 90 known species of cetacea currently in existence and they encompass all of the worlds major oceans from the tropics to the coldest of the northern and southern polar hemispheres.
When it comes to passing gas, farting is a common characteristic that most land and marine mammals have in common with one another.
Passing gas allows animals to release air that is trapped inside their stomach, which could lead to digestive problems, stomach cramps or other complications if not removed from the body.
When an animal passes gas or farts the air that comes out of the body comes primarily from two main sources.
The first source comes from oxygen that is pulled in through the air either while breathing (inhaling and exhaling) or when consuming food or drinking water; and since all mammals eat food and require oxygen to survive they all take in air.
The second source of air or gas comes from food that is broken down by enzymes, stomach acids and bacteria in the stomach, which creates toxic gasses that need to be removed from the body to prevent it from doing harm to the individuals digestive system.
In order to release these gases animals need a way to expel them from the body and for most mammals this means that the toxic gas has to exit through either the mouth, which causes burping or through the anal tract which causes farting.
The gases that are expelled from a fart are mostly composed of hydrogen, carbon dioxide, and methane.
The reason some gasses smell worse than others is because of the breakdown of the foods involved.
Certain foods can cause obnoxious orders when released as gas while others do not.
From some of the statements researchers have made about whales farting they have concluded that yes, it stinks when a whale farts.
When a whale farts or passes gas underwater the sound is believed to be suppressed by the surrounding water making it silent or at least quite compared to the gas that is expelled from land based animals.
In some cases bubbles or clouds can be seen rising to the surface of the water when a whale passes gas.
Those most likely to experience whales farting are likely to be researchers involved in following whales and researching their dung or gathering information about their gestation period, habitat, social structure and other important factors.
In some cases this may also be observed by tourists and whale watchers that are hoping to get a glance of these marine mammals in their natural habitat.
Unfortunately not much research has been done on this topic, however there have been researchers who have experienced and confirmed that yes whales do indeed fart.