Convert Text Documents with textutil

Apple's built-in converter for txt, rtf, rtfd, html, doc, docx, odt and webarchive files.

macOStextutilconversionhtmlrtfLow risk
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.rtf

02What 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

RiskLow risk

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: Files & Folders