Be the first to know and get exclusive access to offers by signing up for our mailing list(s).

Subscribe

We ❤️ Open Source

A community education resource

2 min read

How to batch convert docx files using LibreOffice

Quickly convert docx files into odt, pdf, html, and more.

Years ago, I created dozens of documents using Microsoft Office for graduate school assignments. When I needed to convert those files to a different format without relying on an online tool, open source came to the rescue.

For example, five years ago I took a course where all the documents were provided in docx format. Was there an easy way to convert those files to the open odt format? Absolutely, and it’s simple:

$ libreoffice --headless --convert-to odt *.docx

The above command will convert all docx files in the current directory to odt format.  

Read more: 5 tips to get started on accessibility

But, what if I wanted to convert those same docx files to html so I could easily share them on my classroom website? No problem:

$ libreoffice --headless --convert-to html *.docx

Or maybe I wanted to create PDFs from those documents? Just a slight tweak to the command:

$ libreoffice --headless --convert-to pdf *.docx

Running LibreOffice from the command line inside the folder with your files is straightforward, and the conversion only takes a few seconds depending on your processor and memory.

To explore even more command-line features, use the help attribute:

$ libreoffice --help

This is a perfect example of the power and flexibility that open source software brings to everyday tasks.

More from We Love Open Source

This article is adapted from “The power of LibreOffice” by Don Watkins, and is republished with permission from the author.

About the Author

I am Don Watkins, a free and open source software (FOSS) advocate.

Read Don's Full Bio

The opinions expressed on this website are those of each author, not of the author's employer or All Things Open/We Love Open Source.

Want to contribute your open source content?

Contribute to We ❤️ Open Source

Help educate our community by contributing a blog post, tutorial, or how-to.

We're hosting two world-class events in 2026!

Join us for All Things AI, March 23-24 and for All Things Open, October 19-20.

Open Source Meetups

We host some of the most active open source meetups in the U.S. Get more info and RSVP to an upcoming event.