In the biblical flood story, rain fell for 40 days while Noah was aboard the Ark.
Genesis describes rain falling for forty days and forty nights after Noah, his family, and the animals entered the vessel. The account presents this rainfall as the immediate cause of the floodwaters covering the earth. The number forty is a recurring biblical period associated with testing or transformation, including Moses' forty days on Mount Sinai and Israel's forty years in the wilderness.
The forty days of rain should not be confused with the total duration of the Flood. Genesis also says that the waters prevailed for 150 days, so the rising and remaining floodwaters lasted much longer than the rainfall itself. Different religious traditions interpret the story literally, symbolically, or as part of a wider group of ancient flood traditions, but the forty-day rainfall is the specific duration given in Genesis.