Convert Word, RTF and HTML documents from Terminal — via SS64
textutil converts documents between plain text, RTF, HTML, Word (.doc/.docx) and OpenDocument, and can merge several files into one. Handy for turning a pile of .docx files into searchable plain text without opening Word.
Takes effect right away
The easy way
cdinto the folder and run the command. It creates a newconvertedfolder (and stops if one already exists) and writes a .txt file there for each .docx, so nothing next to your originals is touched.- Other formats:
txt,html,rtf,rtfd,doc,docx,odt,webarchive. - Merge files into a new, unused file name:
textutil -cat html -output combined-new.html ./*.rtf.
Command
Run in Terminal (Applications › Utilities).
mkdir converted && for f in ./*.docx; do textutil -convert txt "$f" -output "converted/$(basename "$f" .docx).txt"; doneComplex Word layouts (tables, images) won't survive conversion to plain text. Pick output names that don't already exist, because textutil replaces a file with the same name. To undo, delete only the files and folder the command created.
Sources
- textutil — by SS64
- Source reviewed
- 2026-11-02
- Link checked
- 2026-11-02
- Tested hands-on
- Not by Oddbyte.Me
Oddbyte.Me hasn't tried this on every macOS version, so keep the undo handy.