I'm looking for free software that can convert OpenDocument to HTML or markdown.

Pandoc can convert HTML to OpenDocument, but not the reverse.

odt2html.py failed to install using both pip and easy_install.

LibreOffice can reportedly do the conversion; however, I couldn't get it to work with the following command:

soffice --convert-to --outdir . htm:HTML my.odt

You're using --convert-to, but you're not specifying the value for it.

The correct syntax is:

soffice --headless --convert-to htm:HTML --outdir . my.odt

Or try to use the following script:

#! /bin/bash

# rm -rv "$2"
mkdir -p "$2"

for F in `find $1 -type f -name "*.doc" -or -name "*.odt"`; do
  BASE=`basename $F .doc` ; BASE=`basename $BASE .odt`
  soffice --headless --convert-to htm:HTML --outdir $2 $F
  tidy -q -config $CONFIG -f $2/$BASE.err -i $2/$BASE.htm | sed 's/ class="c[0-9]*"//g' > $2/$BASE.html


$ convert_doc_to_html.sh SOURCE_DIR TARGET_DIR


  • Right! I copied the command from somewhere else and I hadn't noticed the problem with syntax because of the /Applications/LibreOffice.app/Contents/MacOS/ part. Thanks. – fifi finance Mar 4 '15 at 14:40

New versions of pandoc, the open source universal document converter, work now:

pandoc -t html -s input.odt -s -o output.html 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.