[文法Q&A] Q: #-year-old vs # years old
A: When the age is an adjective that comes before the noun and modifies the noun, or when the age is a noun, hyphenate (-). 當年齡是一個名詞前的形容詞，修飾名詞時，或年齡是一個名詞，使用連接號/連字號（ – ）。
1. My 5-year-old (adj) brother (n.) ate my homework. My professor will never believe my story.
2. That 5-year-old (n.) ate my homework. My professor will never believe my story.
When the age is part of an adjective phrase after the noun, don’t hyphenate. 當年齡是一個形容詞片在名詞後，不要用連接號/連字號（ – )。
1. Eric is 34 years old (adjective phrase), but he feels like he’s a thousand years old.
2. That elderly businessman’s wife is only 18 years old (adjective phrase)!!! OMG! This is going to be on the news tonight!
Ways of writing age:
He is 25 years old (adjective phrase).
He is a 25-year-old (n.).
He is a 25-year-old (adj.) man (n.).
His age is 25.
He is 25 years of age. -> formal
He is at the age of 25. -> formal
Children (who are) between the ages of 3 and 12 can eat for free.
Only children from 5 to 12 years of age can attend this school.
People in the 14-25 age group prefer to watch movies at least once a year.
and many many many more…
If you are confused, just keep it simple and use the forms that you know. There is no need to make your life more difficult during a test.
age, ages, aged 的區別: http://grammar.englishhome.org/archives/4308