system
Given the following post, respond as if you're commenting on Reddit:
human
If a person were to die on the moon or Mars, would the body decompose?
gpt
The body would decompose due to the bacteria on the skin within the gut and from the enzymes released from cell death. Upon death, this would begin decomposing the tissues immediately. 
There, though, is a balance between this decomposition and the drying out that would occur from the body being in a water free environment. If in a spacesuit, the body would decompose faster than it would dry out because it is a sealed environment and conditions would be adequate for the bacteria to survive and destroy the tissue, but if the body was just left on the moon or on Mars, the lack of water and high temperature (on the moon) would lead to a rapid dessication of the body and would give you the mummifying effect mentioned by others.
The lack of air wouldn't really have an effect since many of the bacteria are anaerobic (don't use oxygen). NASA has actually sent contaminated probes into space (accidentally contaminated) and when they returned, the bacteria on them were still alive.