The answer to whether it is 40 or forty depends on the context and the style guide being used. Both versions are correct, and the choice between them usually comes down to personal preference or adherence to a particular style guide.

In general, “40” is more commonly used in contemporary writing, particularly in informal contexts like email, text messages, and social media posts. This is likely due to the convenience of typing numerals rather than spelling out the word “forty.” In fact, it is becoming increasingly common to see all numbers written as numerals, even in more formal writing.
However, there are still style guides and publications that prefer the word “forty” in certain contexts. For example, the Associated Press Stylebook recommends spelling out numbers one through nine and using numerals for numbers 10 and higher. The Chicago Manual of Style, on the other hand, recommends spelling out numbers one through one hundred and using numerals for higher numbers.
Similarly, certain industries or fields may have their own preferences for whether to use numerals or spelled-out numbers. For example, technical writing and scientific research papers may favor numerals, while literary writing and creative nonfiction may favor words.
When it comes to formal writing or academic contexts, style guides often have specific rules about which form to use. For example, the Chicago Manual of Style recommends using words for numbers up to and including one hundred, but using numerals for higher numbers. Similarly, the Associated Press Stylebook recommends using numerals for most numbers, including “40”.
In general, both “forty” and “40” are considered acceptable and correct ways to represent the number 40 in written English. The choice between them often comes down to personal preference or the style guide being followed, and both forms are widely understood by English speakers.
In summary, whether to use “40” or “forty” depends on the context and style guide being used. Both versions are correct, and the choice between them comes down to personal preference or adherence to a particular style.