Yes, hamsters need to be kept separately.
Hamsters are solitary animals with a very strong sense of territory. Therefore, it is strongly recommended to keep them separately. Here are the specific reasons and points for attention:

1. The Solitary Nature of Hamsters
Hamsters are typical solitary animals with an extremely strong territorial instinct. Any of their kind that enters their territory will be regarded as a threat, which may trigger aggressive behavior.
Even during the estrus period, the peace between hamsters is only temporary. After mating, the female hamster will drive away the male hamster.
2. Avoiding Fights and Injuries
When hamsters are kept in the same cage, they are likely to fight over territory, food, or mates. The consequences can range from minor injuries to death.
Even if they are siblings or of the same breed, hamsters may fight due to their sense of territory.
3. Reproduction Issues
Hamsters have a very strong reproductive ability. Keeping a male and a female hamster in the same cage may lead to a large number of offspring in a short period, increasing the burden of feeding.
After a female hamster gets pregnant, she may become irritable and may attack the male hamster or even cannibalize her own cubs.
4. Health and Safety
Keeping hamsters in the same cage may cause the weaker ones to suffer from malnutrition and excessive mental stress due to long-term avoidance, which affects their health.
Keeping them in separate cages can avoid the health risks caused by fights or reproduction.
5. Special Situations
For some breeds (such as Syrian hamsters, Roborovski hamsters), the success rate of cohabitation is slightly higher, but there are still risks. It is recommended to keep them together from a young age and ensure that the cage is large enough.
If mating is required, a "dating cage" can be used for a short-term cohabitation, and the hamsters should be separated immediately after mating.
Summary: For the health and safety of hamsters, keeping one hamster per cage is the best choice. Keeping them in separate cages can not only avoid fights and reproduction problems but also enable hamsters to live a happier life.