Hyphen in compound adjective with numbers

When numbers are used as the first part of a compound adjective, use a hyphen to connect them to the noun that follows them. This way, the reader knows that both words function like a unit to modify another noun. This applies whether the number is written in words or in digits.

The president of the company gave a 10-minute speech to the Board of Directors.
He is knowledgeable in thirteenth-century politics.
The boy threw a rock at the second-story window.

However, a hyphen is not required if the number is the second word in the compound adjective.

He is a victim of Type 2 diabetes.
This elevator doesn’t go down to Basement 3.

Hyphen in compound adjective with fractions

When using a fraction (e.g. half or quarter) as part of a compound adjective, it should be hyphenated so the reader understands which fraction is modifying which noun.

I half-wanted to commit a felony.
A quarter-million dollars is still a large amount of money.
You’ll need one-third of a pound of flour and one egg.
That’s a half-baked idea if I ever heard one!

Hyphen with number of years

Use hyphens when you are using someone’s age as a label.

Four-and-a-half-year-olds are not reasonable about nap time.
The two-year-old’s favorite food was yogurt.

Don’t use hyphens when you’re just talking about a span of time.

We’ve lived here for four and a half years.
Two and a half years is plenty of time to learn how to play tennis.