The American space agency hope the experiment will help with robot design in the future.
They sent the creatures to the International Space Station to see how they get on in zero gravity.
Scientists say they managed to steady themselves very quickly after floating around and even grabbed onto each other for help.
The research suggests that the insects use teamwork to search and explore, in a similar way to ants back on Earth.
They tried their best to search and explore, working in a team, but weren't able to do as much as they do on Earth.
But the experiment wasn't just about looking at how ants behave.
Scientists hope that studying the way the ants ants moved around and work together in space will help in designing groups of robots to operate on the International Space Station in the future.
Nasa has sent ants into space to see if they behave in the same way as they do on Earth.