pull a rabbit out of a hat

pull a rabbit out of a hat

To do something surprising and seemingly impossible; to produce something in a way that has no obvious explanation, as if done by magic. A reference to the magician's trick of literally pulling a live rabbit out of a hat. The caterer really pulled a rabbit out of a hat by producing 100 cupcakes with just 20 minutes' notice. Unless someone can pull a rabbit out of a hat, we're out of solutions.
See also: hat, of, out, pull, rabbit
Farlex Dictionary of Idioms.

pull a rabbit out of a hat, to

To come up with a surprise, usually a pleasant one. The term comes from the magician’s trick of pulling a live rabbit out of a seemingly empty hat. While the trick is old, the term was being transferred to other surprises only from the 1930s on. D. Sannon used it in Death by Inches (1965): “Well, you pulled the rabbit out of the hat.”
See also: of, out, pull, rabbit
The Dictionary of Clichés by Christine Ammer
See also:
  • a/the feel of (something)
  • (I) wouldn't (do something) if I were you
  • a straw will show which way the wind blows
  • a crack at (someone or something)
  • all right
  • (you) wanna make something of it?
  • all for the best
  • a thing of the past
  • a slew of (something)
  • a bird in the hand