pull one out of the hat

pull one out of the hat

To find sudden and/or unexpected success in a situation that seemed otherwise hopeless or likely to fail. An allusion to the classic magic trick of pulling a rabbit (or other object) out of a seemingly empty hat. Wow, I didn't think you'd have the programming ready in time for launch day, but you really pulled one out of the hat! I don't know how you did it in so little time, but you pulled one out of the hat throwing this party!
See also: hat, of, one, out, pull
Farlex Dictionary of Idioms.

pull one out of the hat

bring off an unexpected trick in an apparently desperate situation.
The image here is of a rabbit pulled out of a magician's hat.
1971 James McClure The Steam Pig I must say you've really pulled one out of the hat this time.
See also: hat, of, one, out, pull
Farlex Partner Idioms Dictionary
See also:
  • strike out at (something or some place)
  • get into hot water, to
  • beat (one) to the draw
  • end game
  • a security blanket
  • game is not worth the candle, the
  • hit (something) out of the (ball)park
  • an end run
  • end run
  • the mark of Cain