Skip to content

Convert Word, RTF and HTML documents from Terminal — via SS64

Commandlow riskmacOS 14 Sonoma and later

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

  1. cd into the folder and run the command. It creates a new converted folder (and stops if one already exists) and writes a .txt file there for each .docx, so nothing next to your originals is touched.
  2. Other formats: txt, html, rtf, rtfd, doc, docx, odt, webarchive.
  3. 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"; done
Complex 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

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.

textutilconvert docxwordrtfhtmlterminal

More in Hidden Tools & Commands

Download a full macOS installer from Terminal — via SS64

Commandlow risk

softwareupdate can list and download complete macOS installers, including older versions Apple still serves. Useful for making a bootable USB installer or installing on another Mac without hunting through the App Store. This entry only downloads; it doesn't install anything.