What is the correct punctuation of the phrase: one size fits all [closed]

What is the correct punctuation for the phrase: one size fits all?

I have seen two variants:

  • 'one size fits all', and
  • one-size-fits-all

If the phrase is used as an adjective (which it usually is), then hyphenate it:

It is a one-size-fits-all solution.

This hat is one-size-fits-all.

The phrase could be used as an independent clause, however, with "one size" being the subject:

These hats are great. One size fits all, you know.

So in all but the last case, which I imagine is pretty rare, include the hyphens.