All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
We have not come across the exact number of the Muslims before the migration, but their number was little compared to their number after migration when Islam became stronger and the Muslims were enabled to call to Allah.
The reason why their number in Makkah was little compared to their number after the migration in Madeenah is that the disbelievers of Quraysh were harassing the Muslims and obstruct them from their religion and preventing them from inviting people to Allah. They were fighting against the Da’wah with all their strength, to the extent that some Muslims were forced to migrate to Al-Habashah (Abyssinia) twice. The first time, twelve men and four women migrated. The second time, there were eighty-three men, and eighteen or nineteen women who migrated.
The Muslims were persecuted in Makkah before migration, unlike in Madeenah after the Ansaar embraced Islam, and after the Prophet migrated to it. After this, Madeenah became the land of Islam and the Muslims became safe and honored.
Thereupon, the people came in groups to the Prophet in order to embrace the religion of Allah.
Mukhtasar As-Seerah authored by Shaykh Mohammed ibn Abd Al-Wahhaab reads:
“When the Ansaar embraced Islam, the Messenger of Allah, sallallaahu ‘alayhi wa sallam, ordered the Muslims who were in Makkah to migrate to Madeenah. They indeed migrated and Allah Almighty gave them honor after they were humiliated. Allah says (what means): {And remember when you were few and oppressed in the land, fearing that people might abduct you, but He sheltered you, supported you with His victory, and provided you with good things – that you might be grateful.} [Quran 8: 26]
For more benefit, please refer to Fataawa 177603 and 86409.
Allah knows best.