According to Joseph Bigler, the quotation first came from a certain Robert J. Hanlon as a submission for a book compilation of various jokes related to Murphy's law published in 1980 entitled Murphy's Law Book Two, More Reasons Why Things Go Wrong.
A similar quotation appears in Robert A. Heinlein's 1941 short story "Logic of Empire" ("You have attributed conditions to villainy that simply result from stupidity"), so some claim Hanlon's Razor is a corruption of "Heinlein's Razor". "Heinlein's Razor" has also been defined as variations on Never attribute to malice that which can be adequately explained by stupidity, but don't rule out malice. or ... but keep your eyes open.
Observations on the sway of human error over malice occur in various works. Goethe's The Sorrows of Young Werther (1774) mentions "...misunderstandings and neglect create more confusion in this world than trickery and malice. At any rate, the last two are certainly much less frequent." A likely apocryphal quote from Albert Einstein deals with the power of stupidity: "Only two things are infinite, the universe and human stupidity, and I'm not sure about the universe." Compare Schiller's "Against stupidity, the gods themselves contend in vain." Similarly, Elbert Hubbard said, "Genius may have its limitations, but stupidity is not thus handicapped."
This quotation (in the form "Never attribute to malice what can be adequately explained by ignorance or stupidity") has also been attributed to Isaac Asimov.
A similar epigram has been attributed to William James among others.
Its oldest form[citation needed] was by Napoleon Bonaparte: "Never ascribe to malice that which is adequately explained by incompetence."[4]
Cock-up theory
A common (and more laconic) British English version, coined by Sir Bernard Ingham, is the saying "cock-up before conspiracy". The full quotation given by Sir Bernard is "Many journalists have fallen for the conspiracy theory of government. I do assure you that they would produce more accurate work if they adhered to the cock-up theory."