
In modern use_ willy-nilly_ is mostly used with the meaning "in a haphazard or spontaneous manner." Things performed in a willy-nilly fashion are done carelessly, or without forethought. The word applies nicely to the cake that you decorated without much care, the outfit you assembled from the items on your floor, or any number of other decisions made without due consideration.
But that is actually its second meaning. Its original was a little less playful—closer to 'whether one wants to or not.' As in: this is happening to you, like it or not. Both meanings are still technically alive, though the 'whether you like it or not' sense has faded into archaic territory, surviving mostly in older literature.
Willy-nilly _is a shortened version of a four-word phrase that circulated in the 1500s; _will I, nill I. The will here carries a meaning we still use in English: “to be inclined to,” as in “Will you join us?” Nill, on the other hand, is a word most modern speakers have never encountered, because it effectively died out (surviving only, as it happens, inside willy-nilly). It was simply the negative form of will: “to be unwilling.” Pairing will and nill together ('whether he wills it or nills it') was an economical way of expressing a kind of total indifference to consent.
The expression was clearly in circulation by the late 16th century, because Shakespeare used a version of it in The Taming of the Shrew:
Marry, so I mean, sweet Katherine, in thy bed.
And therefore, setting all this chat aside,
Thus in plain terms: your father hath consented
That you shall be my wife, your dowry ’greed on,
And, will you, nill you, I will marry you.
A similar construction appears in Hamlet, where a gravedigger contemplates the nature of suicide: "If the man go to this water and drown himself, it is, will he nill he, he goes; mark you that."
The modern sense of willy-nilly appears to date to the 19th century, and for at least a few decades both the 'in a haphazard manner' and the 'whether one wishes to or not' senses were in common use.
Architects have been at work on the edifice, in no slip-shod, willy-nilly manner, but according to a most reasonable, eminently intellectual design.
— The Bethany Messenger (Lindsborg, Kansas), 1 Mar. 1906Thomas W. Lawson’s plan to give Pres. Roosevelt, willy-nilly, a third term, through the organization of a new party, which shall make Gov. Johnson, the Democratic executive of Minnesota, the President’s running mate, has provoked comment, amused and otherwise, in New York.
— Bangor (Maine) Daily Commercial, 28 Dec. 1907



