Could guns work in space, or on the Moon?

Yes, most conventional guns would work just fine on the moon or in outer space. To understand why, take a look at the diagram of a typical cartridge. In that diagram 1 is the bullet (the projectile itself), 2 is the case, 3 is the propellant (e.g. gunpowder), 4 is the rim, and 5 is the primer. What happens when you pull the trigger is that another mechanical component (a hammer or striker) smashes against the primer, which in turn heats up and the heat in turn ignites the propellant.

Now the key part is that the propellant contains both the fuel as well as the oxidizer. In the case of gunpowder, sulfur and charcoal serve as the fuel and potasium nitrate (saltpeter) as the oxidizer. This is different from more conventional fires on Earth where oxygen generally serves as the oxidizer. Such fires could not happen in the absence of a source of oxygen (in other words if you took gasoline on the moon and tried to light it, it wouldn't burn). However, because cartridges already contain all chemical components needed for combustion, they can function just fine in the absence of oxygen.

Finally, as a result of the combustion, hot gasses erupt, which propel the bullet down the length of the barrel and outwards. On the surface of the Earth, the bullet will slowly slow down due to air resistance and curve downwards due to gravity. In the quasi-vacuum of outer space on the other hand, the bullet would just keep on going straight without slowing down, basically as a direct result of Newton's first law, which states that an object in motion will continue travelling at that velocity unless acted upon by an external force.

/r/askscience Thread