Several times within the Old and New Testament of the Bible there are notes pertaining to a long time as "40 days," as in 40 days of fasting, rain, traveling, etc. Why 40? Is there a factual association? The only thing I've noticed are references to 40 days needed for mummification in natron. Any insight? Thanks!
I believe it to be an euphemism similar to how today one might say something like gazillions for a large number.
In a society that is mostly innumerate as well as illiterate, where neither pencils nor paper exist and both slateboards and chalk are fragile and rare, the scale of numbers readily accessible to the common population are much smaller than today. The meaning of 40 to me comes across as: "longer than a month, and more days than one would care to count"; or as Wikepedia puts it in that link:
similar to "umpteen".
There is push-back in the comments about my use of the word euphemism above. I stand by that usage. The 1928 edition of the Oxford English Dictionary provides, as an exemplification of (proper) usage, the following from Fur Animals: by Eliott Coues, 1877: (p. 216, start of paragraph)
The skunk yields a handsome fur, lately become fashionable, under the euphemism of Alaska Sable - for our elegant dames would surely not deck themselves in obscene Skunk skins if they were not permitted to call the rose by some other name.
The softening of an exact, possibly estimated, number by the more general and de-nerded forty seems quite inline with Coues' usage.
In a discussion below it became clear to me that I have relied above on a physicist's deep distinction between Accuracy and precision - without making that explicit.
In the context of this discussion, one might regard precision as the choice between hours, days, weeks and months as the unit of measure. Accuracy would be the determination of whether, in the unit of measure chosen, the value specified is the most correct possible, in that unit of measure.
SO the use of the phrase "forty days" appears to be specified with an accuracy determined in days; but actually intends, by convention, an accuracy in months. It means:
"many days, longer than a month, but shorter than many months".
Retaining the connotation of "many" above is important to imbue the sense of "trial" described below by David:
enough time passed for God to achieve a goal. Fullness of time.
Conveniently the number of days in a month (29 or 30) and the number of years in a generation (25 to 30) are close enough so that the quantity 40 is situated comfortably above one and below two such, and is a multiple of 10. This makes it particularly suited to the usage described above, whether days/months or years/generations are the units of measure at issue.
There seems to be a bit of pushback on Pieter's (correct) answer, so perhaps a bit more detail is in order.
It is not at all uncommon in languages to have words that, while technically a specific number, are usually used just to indicate an unspecified large amount. One of the technical terms for this is non-numerical vague quantifiers.
The most well-known of these is of course the Hebrew Bible's "40", but they also had a word for an even larger indeterminate number: רבבה. This word came into English (via Greek) as "myriad", but the technical literal value for it is 10,000.
Probably the next most famous for us English speakers is 1,001, which came into English from the Arabic work 1,001 Nights (which usually doesn't contain exactly 1,001 stories, unless you get an edition that purposely tried to edit to that amount for some weird reason). You can find all kinds of English-language books with titles on the theme "1,001 Uses For...", and nobody really expects those to contain exactly 1,001 of the thing in question.
Now most secular (and mainline Christian) Biblical scholars will tell you that the earliest written source for the Hebrew scriptures (including the story of Noah that prominently featured the indeterminate 40) committed the stories to writing around the 6th Century BC.
This was about 4 centuries before the Hebrews started using their distinctive Greek-borrowed numeric system (which resembles Roman Numerals a bit in implementation). At that time the numeric system in use would have been the old Babylonian Sexagesimal system. This survives today mostly in our units of time and angle "degree" (and thus Earth surface coordinate) measurements. This was technically a hybrid base 60 system, but represented with a weird base 10 tally system within the 60.
If that sounds complicated to you, you're probably still better off than the common Semite, who as Pieter pointed out, probably didn't really know how to read or use this system themselves beyond the bare basics required for everyday life. Doing reckoning under this system was much harder than what we have today, and there was no equivalent to the modern western education system, where every child gets basic mathematics instruction. Working with numbers that high was difficult, and very few in the audience of these stories would have been trained to do so.
You may notice that the superglyph for 40 specifically is the first one where there isn't enough space for all the 10's tallies on one line, so you have to start compressing them together into 2 lines in the same amount of space. Perhaps its a coincidence, but this is certainly the point where the writing/carving for numbers starts to look like a bit of a mess. Its a lot.
Biblically, Forty is a number associated with testing and trials
Jesus wandered in the wilderness 40 days, Israel wandered in the desert for 40 years etc.
It's a number that indicates enough time passed for God to achieve a goal. Fullness of time.
Motivation for the answer
I'll take a literary approach, aiming less at the surrounding historical context and more at an internal analysis of what "significance" the document's authors intended to convey.
However, rereading your question and David Robinson's comment, I see that you're not asking about this significance so much as the motivation to use "40" specifically. Thus, this answer doesn't directly address your question. But I do believe it provides an important foundation for an answer, because understanding the purpose a tool was used for helps understand the choice of tool.
Both Pieter and T.E.D. offer explanations of the choice of tool, and in that regard the answers will be more satisfactory. But the implied or stated purpose they are based on almost certainly misses the mark. I submit that both traditional and modern biblical scholarship would say it's unlikely that the purpose, the force of using "40" is to have an indeterminate number on hand. It certainly is not a euphemism (there is no social taboo to soften); it certainly is not due to the impossibility or awkwardness of inexpressing bigger numbers with precision or with vagueness (both are done often enough); and the biblical authors were not interested in de-nerding what is in fact a very nerdy document replete with specific numbers both large and small, particularly in the Pentateuch, where we find many of these same narratives that strategically use "40".
Some answers have suggested mathematical reasons for "40", computing percentages or aligning the numbers with other (supposedly) significant values. I find these anachronistic and atypical of biblical narrative structure.1
Pieter's and T.E.D.'s suggestions of a number system cutoff (or significant change) and of averaging out months or lifespans are more likely, more interesting, more basic motivations. But why did the writers (or the speakers of the language they used) look to natural or manmade phenomenon of around that size? Hopefully the discussion below concerning the function of "40" from the perspective of the document helps clarify what the tool is for for any other answerers.
We can make one observation in line with the previous answers, namely that it is almost certainly not a literal but a symbolic value.2 In that sense, it is indeed an "indeterminate" number in that one is not interested in the exact value.
But we can also make the observation that though it may stand for an indeterminate number, it's not exactly an "indeterminately large number" in the sense of "more than one would care to count". The Bible is well aware that 40 is too small a unit for such purposes, and for big, vague numbers it prefers rounded-off hundreds, thousands, tens of thousands, or even hundreds of thousands (Deut 32:30, Josh 23:10, 1 Chron. 12:14, Judges 15:16, Psalm 91:7, 1 Sam. 13:2, 2 Sam. 18:3, Lev. 26:8, 1 Sam. 15:4, Num. 11:21, NT Rev. 7:4, etc.). Hence, reading "gazillions" or even "umpteen" for the biblical 40 seems to miss the mark.3
So does 40 simply mean "an indeterminate small number"? Maybe. After all, it's probably around as small as you can get and still be indeterminate! But I think the Bible has a narrower use for it. There is indeterminacy, but that's not the force of the biblical use.
Significant block of time
One important note is that this number almost uniformly counts a period of time.4
When speaking of years, some instances: The Israelites wandered in the desert 40 years, with the explicit effect being that a whole generation died off (Num. 32:13). Moses fled Egypt at 40 years old (Acts 7:23) and returned 40 years after that (Acts 7:30). Some patriarchs married at 40, including Isaac (Gen. 25:20) and Esau (Gen 26:34). More than one king is said to have ruled for 40 years (e.g. 1 Sam. 4:18). In Jewish tradition, a person is allowed to study the Kabbalah at 40.5
When speaking of days, some instances: Noah's rain fell for 40 days and nights (Gen. 7:4); the spies explored Canaan for 40 days (Num. 13:25); Goliath taunted the Israelites for 40 days (1 Sam 17:16); Moses thrice spent 40 days and nights on Mount Sinai (Deut. 9:11, 9:25, 10:10); Elijah took a journey of 40 days to Mount Horeb (1 Kings 19:8). Embalming a corpse required forty days (Gen 50:3) — cp. your note on natron. In the NT, borrowing from this tradition, Jesus spends 40 days in the wilderness (Matt 4:2) and sticks around for 40 days after resurrection (Acts 1:3).
I would thus offer an interpretation for "40 years" as a single generation in the sense of having lived a full life (in ancient terms!): you are not just the nominal "adult" of your 12/13 years at bat mitzvah or bar mitzvah, but have lived the whole span that most adults enjoy and acquired a certain measure of wisdom and experience by doing so. This fits with the marriages mentioned above; 40 would be a rather old marriage in ancient times, but if it means "having accrued the fullness of age", it makes sense. (As a corrolary, your time is over and it's now your children's time.) It's a unit, a mini-epoch, a building block in a history or geneaology of a nation — which is the sort of thing the Bible is deeply concerned with, even symbolically.
Meanwhile, for "40 days" we can extend and miniaturize that meaning: it's a significant block of time within an average lifespan. We might say that 40 days is to a person's lifetime what 40 years is to a nation's history: a unit of time big enough to mark a change or a significant event.6
Wikipedia tells me this reading is corroborated by Michael Coogan.7
Other commentators, such as Ellicott in the 19th century, identified the number as one indicating "trial and patience", which fits well with the idea of a significant event (but doesn't agree with my focusing on a generation).
Meanwhile, the Pulpit Commentary (also 19th century) cites Trench that it's sometimes a "signature of penalty, affliction" and confession of sin, and other times a sign that "work is completely [and thoroughly] done".
These are widely accepted, established readings, in line with other commentators (except literalists who take "40" to be a precise value). I don't believe there are many who would say that the force or purpose of using "40" is to select an indeterminate number or to suggest that the exact value doesn't matter in a given context. Sure, it doesn't — but that's not the reason they chose "40".
To me these interpretations reinforce the idea of communicating a whole "unit" of time, whether that unit is characterized by trial or by simple "fullness".
1 When I talk about what the Bible "means" by the number I make no reference to supposedly hidden significance such as numerological or mystical interpretations.
2 There are at least three numbers that come up too often and at too useful a time to be coincidence: 7 / 70 (completeness; the root is related to "satiate"), 12 / 144 (traditional number of tribes of Israel, frequently recurrent), and of course 40. Some other lists include more, but the wider the net cast, the less compelling the explanation of function seems to become.
3 As someone who reads Biblical Hebrew daily, I should note that T.E.D. makes a mistake when citing the word רְבָבָה revavah. This word stems from the root רבב r-b-b meaning "to multiply, to become many", and is a good candidate for "indeterminately large number". Wiktionary and other dictionaries' gloss "10,000" does not refer to the "technical, literal value" of revavah but to precisely the figurative value "10,000" carried in early translations such as the KJV.
4 One exception is the number of se'ahs in a mikvah; this correspondence is only established by extrabiblical tradition.
5 Although, as the linked article notes, this appears to be only ambiguously supported by the Talmud.
6 In sacred matters, the Bible does sometimes use the metaphor of a person for a nation, particularly the Israelite nation.
7 Michael David Coogan, A Brief Introduction to the Old Testament: The Hebrew Bible in Its Context, Oxford, 2008, p. 116.
What is the significance behind “40 days” that often appears in the Bible?
The significance isn't in the actual number. That's modern bias. The significance is in the collection of 146 uses of the number 40 in the Bible.
Numbers in the Bible aren't meant to convey literal meaning but used to demonstrate the greater message behind the story. We live in a world where understanding and greater meaning comes from quantify-able observation. The Bible was written before this time when real world events were believed to obscured the greater meaning of events (Plato) or the real meaning of events had to be decreed through intuitive means prior to making observations (Aristotle).
Plato's Cave Allegory Plato claimed that knowledge gained through the senses is no more than opinion and that, in order to have real knowledge, we must gain it through philosophical reasoning. In the Allegory of the Cave, Plato distinguishes between people who mistake sensory knowledge for the truth and people who really do see the truth.
Aristotelian physics - Aristotle's principles were not based on controlled, quantitative experiments, so they do not describe our universe in the precise, quantitative way now expected of science.
We live in the world influenced by Galileo and his approach where observed numbers are what determine meaning. We live in a world biased by numbers and thus biblical times are counter intuitive to us as much as our world would be counter intuitive to biblical writers.
History of scientific method
During the period of religious conservatism brought about by the Reformation and Counter-Reformation, Galileo Galilei unveiled his new science of motion. Neither the contents of Galileo’s science, nor the methods of study he selected were in keeping with Aristotelian teachings. Whereas Aristotle thought that a science should be demonstrated from first principles, Galileo had used experiments as a research tool.
The Bible was written in the ages when Plato and Aristotle's ideals dominated disciplined educated minds. The age when the real meaning of events was not decreeable through observation. Numbers as representations of events were not persuasive or interesting but deemed dangerous. So rather than attempt to relay actual numbers for events, numbers are used in the Bible to link like events and convey the greater meaning behind the story or event. As David said, 40 is generally used in the bible to symbolize a period of testing, trial, or probation. from Moses, Jonah, Ezekiel and Jesus 40, appears 146 times in scripture in stories and events with this reoccurring theme.
Moses crosses the Sinai Peninsula in 40 years after leading his people out of Egypt.
Mosses spends 40 years in Egypt before leading the exodus.
Mosses spends 40 days and nights on Mount Sinai to receive the 10 commandments.
Ezekiel lays on his right side for 40 days to symbolize Judah's sin.
Jonah warns Nineveh for 40 days of it's destruction.
It rained for 40 days and nights flooding the world to float Noah's Arch.
After being baptized by John, Jesus fasted for 40 days and nights in the desert.