I have 10 buttons (4 f, 6 m) in a rubbermaid tote about 2'x3' and they get along fine. My others are in a rat manor cage that is divided top and bottom. The top part has 2 females and 4 males, the bottom has 3 females and 4 males.
You need to make sure the spacing is no more than 1/2", and they shouldn't be kept on wire. My birds that are together were all hatched together and get along fine as a group.