"To hit the fan" is an idiomatic American English expression that means "to go completely or chaotically wrong." The saying relies on an evocative visual metaphor involving the interaction between a thrown object and the whirling blades of a fan. It is usually used to identify the point at which a situation takes a catastrophic turn; it's commonly used in phrases like "and that's when it hit the fan." The most common use of the term involves profane slang for feces, creating an uncomfortably vivid visual metaphor that leaves the listener in no doubt as to the messy and unpleasant nature of the situation.
The earliest recorded uses of "to hit the fan" date from the 1940s, although some authorities claim that the usage dates back to the 1930s. One early version, "when the soup hit the fan," relies on the visual image a fan spraying soup across a startled group to evoke a sudden descent into chaos. The vulgar version of the expression is documented as early as 1967, but may have been in use even longer. Lexicographers can often be reluctant to document profanity, meaning that the origins of foul language are often harder to trace than those of more socially-acceptable expressions.
Like many successful expressions, "to hit the fan" relies on its colorful imagery to communicate its meaning. Even though it refers to a circumstance most people have been fortunate enough not to experience, the image is a good visual shorthand for total chaos. Additionally, the metaphor conveys more information, in that the sudden shift from peace to panic comes from the interaction between an existing situation (the spinning blades of the fan) and a malicious or careless act (the actions of whoever threw something into the fan blades). The resulting catastrophe is thus the result both inevitable and the result of human negligence or stupidity.
The expression "all hell breaks loose" has a similar meaning to that of the phrase "To hit the fan." These are characteristically colorful pieces from the American vernacular which have spread to other branches of English. The predominant version of the expression is probably the vulgar version, which has the inventive and vigorous characteristics of great slang. Its vulgarity, however, means that the more general expression discussed here is probably more widely used in print. This is the case with a number of slang expressions.