Fish float upside down when they die because of gases.
The gases in bodies of fish at the time of death and those released when they start decomposing, tend to collect in their internal organs, located in the front center of their bodies.
This causes a fish’s body to turn over and float to the top of the water when they die.
Sometimes dead fish appear on beaches in large numbers and it starts to smell really bad after a while.
Sometimes, the cause is pollution, but it’s also possible for disease to wipe out large numbers.
If you’re at the beach and you see just one dead fish, it might be that it just died of old age.