system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What gives fire its shape?
gpt
When air is heated, it tends to expand.

To explain why it expands - Heat is basically the measure of vibration and movement of the actual molecules within a substance. When something is solid, these vibrations don't have enough energy to stop the attractive forces between the molecules thus they stay mostly in place.

When something is a liquid, the molecules have enough energy to repel a LITTLE bit from the attracting forces, but can at least move so they tend to slide over one another and create something that flows - A liquid.

Something that is a gas has enough energy for each molecule that they have completely freed themselves from one another, and will expand to fill any container that they are in because they are basically just constantly slamming into one another as they move. This is what causes pressure because the molecules are constantly bouncing off of one another and forcing each other away, and WANT to move outward.

The hotter something is, the more it wants to expand as the movement of the molecules increase. Thus the lower density it would have as it expands.

This expansion lowers the density of the air that is being heated by the flame, as such it wants to rise upward because the cold air around it is more dense and forcing the hot air upward. Hot Air balloons work on this idea. 

So in essence what you are seeing is not the exact shape of the fire, but what the air that is moving upward forms it into.

In space, fire would be much more stable in its shape and be mostly rounded as there is no gravity for hot/cold air to convect against.