What does the number forty (40) mean in the Bible? What’s the significance of that number?
Forty Days and Forty Nights
When I think of the number 40, my first thoughts turn to the flood. When God judged sinful mankind and spared only Noah and his family , “rain fell upon the earth forty days and forty nights” (Gen 7:12) and so the 40 days are seen as a judgment of God. Why 40 days? It was when “The Lord saw that the wickedness of man was great in the earth, and that every intention of the thoughts of his heart was only evil continually. And the Lord regretted that he had made man on the earth, and it grieved him to his heart” (Gen 6:5-6) “So the Lord said, “I will blot out man whom I have created from the face of the land, man and animals and creeping things and birds of the heavens, for I am sorry that I have made them” (Gen 6:7). In this case, the number 40 seems to be associated with the judgment of God being carried out. Certainly the number 40 is to be taken literally as for how many days the rain came down, but I don’t believe it’s any coincidence that the number 40 was involved in the number of days as it was a judgment from God for mankind’s central focus of every thought to do evil.
Marriage and Forty
Genesis 25:20 shows that “Isaac was forty years old when he took Rebekah, the daughter of Bethuel the Aramean of Paddan-aram, the sister of Laban the Aramean, to be his wife” and “When Esau was forty years old, he took Judith the daughter of Beeri the Hittite to be his wife, and Basemath the daughter of Elon the Hittite” (Gen 26:34) so can you see a pattern? Did the law say that you cannot marry until 40? No, it’s just that it seems that number does come up a lot in marriages in the Bible.
Times of Testing or Judgment
When Moses went up Mount Sinai, he was there for 40 days and nights and the Israelites rebelled and made a golden calf. They failed to wait even 40 days for Moses to come down off the mountain and so they were tested but failed. In the case of Moses, where he fled Egypt for killing an Egyptian, he remained in the desert wilderness tending sheep for 40 years, after which God called Him to bring Israel out of Egyptian bondage. In a few places in the Bible, the number 40 seems to be a probationary time as when Israel, who due to their rebellion, did not cross over into the Promised Land. Instead, they wandered in the wilderness for 40 years which is clearly seen as a judgment of God.
When Jesus was tempted in the wilderness by the Devil, it was for 40 days and nights, the same number if days between Jesus death and His ascension. In Jesus scourging, it is believed that the Roman’s soldiers flogged or whipped Jesus much more than 40 lashes as the Old Testament law allowed (Deut 25:3). There was also the account where the spies went into the Promised Land to see what it was like and who was there and they were gone 40 days and nights and because Israel refused to cross over, God said it would be “According to the number of the days in which you spied out the land, forty days, a year for each day, you shall bear your iniquity forty years, and you shall know my displeasure” (Num 14:34). Even though Israel was disobedient, in the same 40 year period that they wandered about in the wilderness, God said “For the Lord your God has blessed you in all the work of your hands. He knows you’re going through this great wilderness. These forty years the Lord your God has been with you. You have lacked nothing” (Deut 2:7) so God was faithful (of course!), even when Israel wasn’t.
Forty Years of Rest
During the times of the judges, before there was a king in Israel, there were judges who would rule but would the nation would eventually fall into idolatry. Each time they did, God sent another nation to afflict them with the purpose being that they would repent and turn back to Him. It was like a cycle; prosperity and proper worship; prosperity and forgetting God; prosperity and worshiping idols; disaster  and captivity and then they would repent and God would bring them back from their afflictions and the land would have rest for 40 years. This happened over and over again (Judges 3:11, 5:31, 8:28, etc.) and every time they cried out to God and again, He would deliver them and give them 40 years of rest.
Whatever the number 40 portrays or symbolizes in the Bible, the purpose of testing is to humble us and to show us how strong or weak our faith is. God doesn’t test our faith so that He will know but so we will know. We’ll have times of trials, tests, sufferings, and we may be wandering in a spiritual wilderness for a time, but rest is coming; the true rest that is found when we place our trust in Jesus Christ.
Take a look of this collection of articles: Bible Answers to Questions 
Resource – Scripture quotations are from The Holy Bible, English Standard Version® (ESV®), copyright © 2001 by Crossway, a publishing ministry of Good News Publishers. Used by permission. All rights reserved.