Before the tower of Babel everyone had one language, as the verse says,
And the Lord said, They are one people, and they speak one language, and they began to build it. Soon nothing can stop what they plan to do.
Come, let us go down and confuse the language you speak so that you no longer understand each other.
Genesis 11: 6-7
But we have in the lineage of the previous chapter the following verse,
These were the sons of Javan: Elishah, Tarshish, Kittim, and Rodanim.
From them proceed the maritime peoples, who have separated themselves into their territory, according to their language, each according to the clans of their nations.
Genesis 10: 4-5
Some people think this is a contradiction, citing a fact in the previous verse that did not occur in the later verse. What in fact is the search merely to seek a contradiction where there is none.
First we should note that the building of the Tower of Babel is idealized as a project of Nimrod, for in the period it determined that it was powerful on earth.
Gen_10: 8 And Cush begat Nimrod; it began to be powerful on earth.
The point is that in verse 10 we have the genealogy, and quotes the final generation of Japheth. If we look at the organized diagram of the generations of Noah's three sons, we have that such are in Nimrod's line of existence. Thus, in these individuals the mixing of languages occurs.
In fact if we read chapter 11 and verse 10, we have:
Gen 11:10 These are the generations of Shem: She was not a hundred years old, and begat Arphaxad two years after the flood.
And if we read in chapter 10 verse 22
Gen 10:22 The sons of Shem: Elam and Asshur and Arphaxad and Lud and Aram.
Now it is irrational and completely misread to think that before chapter 11 one cannot cite something that happened in chapter 11. It would be like thinking that there is a Noah son of Noah before the Tower of Babel, and another son of Noah named Shem. after the Tower of Babel, knowing that at this time Noah was not even alive. Thus, a person who tries to imagine that this is a contradiction would need to learn to read texts.
Thus the genealogy of Noah's three sons is cited in chapter 10, and then in chapter 11 is the genealogy of Shem, for Shem descends all the Semites. Thus, it is clear by observing the scheme, in the sons of Javan the mixing of tongues occurs, and that the sons of Javan become the Greeks, and connect with the Mediterranean by sea voyages, and thus we have the formation of the Greek language.
Already in the sons of Shem we have the fixation on the Euphrates, to their extreme in Ur of the Chaldeans. Generating the dialects, in the case of Abraham the Ugaritic, which is linked to the Semitic languages.
And so there is no contradiction in the bible about such an event.