Tomer Czaczkes and colleagues from University of Regensburg, Germany conducted an experiment to determine whether distinct brown patches they observed forming in ants' nests were feces.
In the study, 21 white plaster nests were inhabited by 150-300 black garden ants (Lasius niger) for two months.
Researchers fed the ants food dyed with either red or blue food colouring and observed the nests for the colourful feces.
They found that one or two corners of each nest started to fill with feces that was the same colour as the food they were fed.
Also Read
They also discovered that the ants didn't just put their toilets anywhere - almost all the ants placed their toilets in the corners, 'phys.Org' reported.
"The patches were not randomly distributed around the nest, but rather localised primarily in the corners of the chambers," researchers said.
"For ants, which like us live in very dense communities, sanitation is a big problem," said Czaczkes.
"Ants normally keep a very clean nest, and usually throw out dangerous rubbish, like food remains and corpses," Czaczkes said.
"Some insects use feces for defence, as building materials, as manure for their crops, and as markings. Perhaps these toilets are also gardens for crops, or even stores for valuable nutrients," said Czaczkes.
The study was published in the journal PLOS ONE.