When to put a hyphen between two words?

Hyphens are used when two or more words function together as a single descriptive unit before a noun, called a compound modifier — for example, “a well-known author” or “a five-year-old child.” They’re also used in compound numbers (“twenty-three”), certain prefixes before proper nouns or numbers (“mid-1990s,” “anti-American”), and to avoid confusion or awkward letter combinations, like “re-cover” versus “recover.” Hyphens generally aren’t needed when the same compound modifier follows the noun (“the author is well known”) or when the first word is an adverb ending in “-ly,” as in “a highly rated app.” Rules vary slightly by style guide, and conventions shift over time as compound terms become familiar enough to merge into single words. When unsure, check a dictionary or style guide for that specific phrase.