keep (something) under one's hat, to

keep something under one's hat

Fig. to keep something a secret; to keep something in one's mind (only). (If the secret stays under your hat, it stays in your mind. Note the use of but in the examples.) Keep this under your hat, but I'm getting married. I'm getting married, but keep it under your hat.
See also: hat, keep
McGraw-Hill Dictionary of American Idioms and Phrasal Verbs. © 2002 by The McGraw-Hill Companies, Inc.

keep under one's hat

Preserve the secrecy of something, as in I'll tell you about it if you promise to keep it under your hat. This usage alludes to hiding a secret in one's head, covered by a hat. [Late 1800s]
See also: hat, keep
The American Heritage® Dictionary of Idioms by Christine Ammer. Copyright © 2003, 1997 by The Christine Ammer 1992 Trust. Published by Houghton Mifflin Harcourt Publishing Company. All rights reserved.

keep (something) under one's hat, to

To preserve secrecy. This term, with its vivid image of hiding a secret under headgear, dates from the late nineteenth century and has remained current even though hats are worn much less frequently today. A popular song of the 1920s had it: “Keep it under your hat! You must agree to do that. Promise not to breathe a word” (quoted by Eric Partridge). See also in the dark.
See also: keep
The Dictionary of Clichés by Christine Ammer Copyright © 2013 by Christine Ammer
See also:
Idioms browser ?
Full browser ?