About 40,000 ready for war passed over before the Lord for battle, to the plains of Jericho (ESV).
From this verse alone, you might think that there were a total of 40,000 soldiers in the army of Israel, set to conquer the land. The problem is that according to a census taken prior to the crossing of the river Jordan, of all of the Hebrew men of fighting age (Numbers 26:1-4), the census gave a total number of 601,730 (Numbers 26:51). A previous census taken near the beginning of the wilderness journey, just after the Exodus from Egypt, reveals about the same number, 603,550 (Numbers 1:45-46). The second census is different in that the first generation in the wilderness had perished, replaced by a new generation, leaving only Joshua and Caleb from the first generation still among them, but the numbers are in the same ballpark. Clearly there is a problem lining up the 40,000 armed men that crossed the Jordan with the some 600,000+ recorded in each census.
Nevertheless, the problem is more difficult than this: Assuming a 600,000+ army, this would give you a much larger population total, if you include women and children, at least around 2 million.
That is a lot of people.
In Deuteronomy 7:1-7, we read that God was sending the Israelites into a land to clear away seven different nations of people, each nation being larger than Israel herself. That means at least 14 million people were living in the Promised Land that Israel was to possess, in Canaan, which would be greater than the current population of the corresponding land in the Middle East now. Considering that Gaza alone is one of most densely populated places on earth, it is difficult to comprehend such large numbers of people in the ancient near east, particularly when the current archaeological data shows that the land of Canaan was far less populated then than it is now.