Hamsters and rats have very different needs and personalities, in spite of both belonging to the rodent family. This means they require different things from their owners.
Rats thrive on the company of their own kind, and should always be kept in pairs or groups, whereas most hamsters – including the most popular species, the Golden or Syrian – are loners. A rat kept on its own will become lonely and sad.

The most popular hamster varieties need to be kept alone
Rats need a lot more space than hamsters, being larger animals, and also to stop them fighting. Although they require company, they can turn on each other if their living conditions are too cramped.
Given the facts mentioned above, do you have space for two rats? Each rat needs about two cubic feet of space as a minimum. That means for two rats you’ll need at least a cage with at least four cubic feet of space – and the larger, the better.

Rats are the largest of the commonly kept rodents, much larger than even the biggest hamster
Rats have a reputation for being more affectionate than hamsters, but this will always vary on a pet-by-pet basis. Rats can certainly be extremely affectionate pets, bonding strongly with their owners and actively seeking out attention and affection. This is down to the fact that, by rodent standards, they are very intelligent, and this can certainly make them very entertaining.