First, let’s say that there really isn’t any official protocol for what happens to your body when you die in space. NASA’s official policy says such a decision will be a joint decision by NASA leadership, international partners, and flight operators.
However, according to Chris Hadfield, astronaut and former commander of the International Space Station, the space agency runs “death simulations” with astronauts looking at these scenarios. Hadfield said of the drill’s conclusion: “If someone dies on a spacewalk, we’ll bring them inside the airlock first. They’ll probably stay inside their pressure suits. Bodies actually rot faster in a spacesuit, and we don’t want the smell of rotting flesh or gas inside the station. So we have to keep them in their clothes and store them in a cold place at the station.”
If death does occur inside the International Space Station, the problem can be resolved relatively quickly: temporary storage on the colder part of the ISS, followed by what will likely be the greatest hearse collection/funeral cortege in human history.
But for longer missions, such as a trip to Mars, other solutions will be required.
Of course, if you want to turn a former colleague into a potentially dangerous space wreck, you can launch the body into space. This is actually contrary to the UN space debris reduction treaty and could potentially cause an international crisis.
An alternative proposed by a NASA research team is to attach the body inside a body bag to a robotic arm outside the spaceship. After the body freezes, the arm begins to vibrate the body bag. This process is done for 15 minutes until the fragile body is reduced to small pieces. The water is allowed to evaporate from the bag through a vent, leaving about 25 kilograms of residue to take back to Earth.
So what happens to the body of someone who goes to the red planet and dies there?
Because NASA doesn’t want to pollute Mars, it thinks the corpse should be incinerated to kill any microbes that will come from Earth. If this is not possible, then they will either be buried in Martian soil or left on the surface.
A corpse left on Martian soil does not decompose as it does on Earth. In fact, the bacteria start the process of eating the body as soon as it dies, but when the corpse freezes at night, the bacteria are finished. In the absence of bacteria, the soft tissues remain stable and you are mummified on the surface of Mars.
Without the protection of the Earth’s atmosphere and magnetosphere, radiation breaks up the corpse more, but this is also a very long process. Your bones will likely remain on Mars for tens of millions of years into the future.