How to Hyphenate All-in-One
When to write all-in-one with hyphens, which look-alike variants to fix, and how to find, normalize and verify them in plain text without changing meaning.
"All-in-one" takes two hyphens when it works as a single descriptive unit, as in an all-in-one printer. Text often contains broken versions instead: "all in one," "all-in one," "all in-one," or versions built from look-alike dash characters. This guide covers when the hyphens belong, which variants to look for, and how to fix them in a file with a search-and-replace workflow you can check and undo.
What hyphenating all-in-one does to your text
Hyphenating joins three words into one compound term, so the reader sees a single idea rather than a loose phrase. The operation applies to wording that describes something as combining several functions or parts. It does not apply when the words simply mean "together in a single" something. A blind replacement can therefore change meaning, and the workflow below separates safe automatic fixes from cases that need a human decision.
| Example (illustrative) | How the words work | Correct form |
| an all-in-one printer | Compound modifier before a noun | Hyphenated |
| This model is an all-in-one. | Compound used as a noun | Hyphenated |
| The printer is all-in-one. | Compound modifier after the verb | Usually hyphenated; check your style guide |
| We finished all in one afternoon. | Ordinary phrase: "all" + "in one afternoon" | No hyphens |
| Keep the files all in one place. | Ordinary phrase meaning "together in a single place" | No hyphens |
A quick test: if "one" is followed by a noun it counts (one day, one place, one go, one sitting), the words are an ordinary phrase and stay unhyphenated. If "all-in-one" describes the noun that follows, or stands as a noun itself, it takes hyphens.
Variants a search needs to catch
Some incorrect forms look nearly identical to the correct one. A search for the plain spelling alone will miss them. Look for these characters between the words:
- Regular space (U+0020): all in one
- No-break space (U+00A0): looks like a normal space but does not match one in a plain search
- Hyphen-minus (U+002D): the ordinary keyboard hyphen and the usual target form
- Unicode hyphen (U+2010): looks like a hyphen but is a different character
- Non-breaking hyphen (U+2011): looks like a hyphen and keeps the compound from splitting at a line end
- En dash (U+2013): slightly longer than a hyphen and wrong in a compound word
- Mixed forms: all-in one, all in-one
A soft hyphen (U+00AD) is a separate case. It is invisible unless a line breaks at that point. It can sit inside the word and stop searches from matching. If a search misses an occurrence you can see, check for hidden characters with an editor that shows code points.
How to hyphenate all-in-one across a file
The commands below assume a Linux or macOS shell with GNU grep, which provides the -P option for Perl-compatible patterns. They also assume Perl and a plain-text file named draft.txt encoded as UTF-8. On macOS, the bundled grep may not support -P. Use Perl for the searches there, or install GNU grep. Word processors and code editors have their own find-and-replace dialogs with different pattern syntax, which this guide does not cover. The same patterns can be adapted, but test them first.
- 1. Confirm the encoding. If the file is not UTF-8, convert a copy first, for example with iconv. Otherwise, Unicode hyphens and no-break spaces will not match as expected.
- 2. Make a backup before changing anything.
- 3. List every candidate, including look-alike characters.
- 4. Automatically normalize only the unambiguous variants, meaning those that already contain at least one hyphen or dash.
- 5. Review the fully spaced "all in one" matches by hand, because some are correct as written.
- 6. Verify the result and compare it against the backup.
# Steps 1-2: check encoding and back up
file -i draft.txt
cp draft.txt draft.txt.orig
# Step 3: list all candidates with line numbers (case-insensitive)
grep -niP '\ball[ \x{A0}\x{2010}\x{2011}\x{2013}-]in[ \x{A0}\x{2010}\x{2011}\x{2013}-]one\b' draft.txt
# Step 4: normalize every variant except the fully spaced phrase
perl -CSD -i.bak -pe 's/\b(?!all[ \x{A0}]in[ \x{A0}]one\b)(all)[ \x{A0}\x{2010}\x{2011}\x{2013}-](in)[ \x{A0}\x{2010}\x{2011}\x{2013}-](one)\b/$1-$2-$3/gi' draft.txt
How the replacement works: -CSD makes Perl read and write UTF-8, so the \x{...} code points match real characters. The negative lookahead (?!all[ \x{A0}]in[ \x{A0}]one\b) skips occurrences where both gaps are spaces. That leaves phrases like "all in one afternoon" alone. The three capture groups keep each word's original letters, and the replacement $1-$2-$3 rejoins them with ordinary hyphens. Because the match is case-insensitive and the original letters are kept, "All-In one" becomes "All-In-one." Mixed capitalization like that needs a manual fix. The -i.bak option edits the file in place and saves the previous version as draft.txt.bak.
The command also replaces non-breaking hyphens (U+2011) with ordinary hyphens. If your layout uses non-breaking hyphens on purpose to keep the compound on one line, remove \x{2011} from both character classes before running it.
# Step 5: review the fully spaced matches by hand
grep -niP '\ball[ \x{A0}]in[ \x{A0}]one\b' draft.txt
For each line, apply the test from the table: hyphenate when the words describe a following noun or act as a noun. Leave them spaced when "one" belongs to a phrase like "one day" or "one place."
Before-and-after example
The text below is an illustrative sample, not output from a test run. Line 4 uses non-breaking hyphens (U+2011) that look the same as ordinary ones.
Our all in one printer arrives in an all-in one box.
The all in-one design saves desk space.
We set it up all in one afternoon.
Ask about the all‑in‑one warranty.
Here is the expected result after step 4, based on how the pattern is written. Run it on your own copy to confirm.
Our all in one printer arrives in an all-in-one box.
The all-in-one design saves desk space.
We set it up all in one afternoon.
Ask about the all-in-one warranty.
Step 5 then flags two spaced matches: "all in one printer" on line 1 and "all in one afternoon" on line 3. Line 1 describes the printer, so change it by hand to "all-in-one printer." Line 3 means "in a single afternoon," so leave it unchanged.
Checking the result
# Count correctly hyphenated occurrences (counts matches, not lines)
grep -oiP '\ball-in-one\b' draft.txt | wc -l
# Show anything that is not the plain-hyphen form
grep -niP '\ball(?!-in-one\b)[ \x{A0}\x{2010}\x{2011}\x{2013}-]in[ \x{A0}\x{2010}\x{2011}\x{2013}-]one\b' draft.txt
# Review every changed line against the original
diff draft.txt.orig draft.txt
In the example, the count should rise from zero ordinary-hyphen matches to three after step 4, and to four after the manual fix on line 1. The second command should list only the phrases you chose to leave spaced. The diff should show changes only to the all-in-one wording. Any other changed line means the pattern matched something unintended.
Undoing changes
To restore the file to its state before step 4, run: mv draft.txt.bak draft.txt. To go back to the very start, copy draft.txt.orig over draft.txt. Keep both backups until the diff and the manual review are complete. Running step 4 a second time overwrites draft.txt.bak with the already-edited version.
Limits to keep in mind
- Line breaks: the commands work line by line, so they miss a compound split across two lines, such as "all-in-" at the end of one line and "one" on the next. Search for those separately or rejoin wrapped lines first. Windows CRLF line endings do not affect matches within a line.
- Capitalization: in headings, many US title-case styles write "All-in-One" with the short preposition lowercase. The commands keep the existing case, so check headings against your style guide.
- Soft hyphens: the patterns do not match U+00AD inside the words. Remove or account for soft hyphens before searching if your source text contains them.
- Context: no pattern can reliably tell a compound from the ordinary phrase "all in one," which is why the fully spaced form is left for manual review.