Convert Text Documents with textutil
Apple's built-in converter for txt, rtf, rtfd, html, doc, docx, odt and webarchive files.
Run `textutil -convert docx file.rtf` to convert in place, or add `-output <path>` to write to a new file.
01Command
Command
$ textutil -convert html -output ~/Desktop/notes.html ~/Documents/notes.rtf02What it does
textutil uses the same Cocoa text engine as TextEdit, so it handles formatting conversion far better than naive encoding tricks. Multiple input files are merged into one output, which is handy for combining chapters or logs. Use `-font Helvetica -fontsize 12` to normalize formatting during conversion, and `textutil -info <file>` to peek at a document's format and encoding first.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- macOS textutil — manipulate text files in various formatsEvidence: Documents textutil -convert, -format, -output and batch behavior across txt, rtf, html, doc formats.
Last verified: 2026-09-17 · Category: Files & Folders