Updated Sep 21, 2026

Utilities

Convert documents between common text formats

One document in, a different document format out.

Agent

overview

What pandoc does

Pandoc reads one connected document and writes the selected output format to the node result. Set --from when the source format cannot be inferred and --to for the required result, such as html, markdown, docx, or epub.

Enable --standalone when the result needs a complete document header and footer rather than a fragment. A connected --template can control the structure of formats that support Pandoc templates.

Pandoc handles document structure and markup conversion. It is not an office rendering engine, OCR system, or pixel-perfect PDF converter.

source github.com/jgm/pandoc

use cases

Where pandoc fits

Publish Markdown as HTML

Turn generated Markdown reports into standalone HTML documents for delivery or archiving.

Normalize document formats

Convert heterogeneous text documents into one downstream format before parsing or review.

Create editable deliverables

Write structured content as DOCX or EPUB without maintaining a dedicated converter service.

reference

pandoc inputs and flags

5 inputs
NameTypeFlagDescription
inputFILE--inputInput document file.
fromSTRING--fromExplicit input format.
toSTRING--toRequired output format.
standaloneBOOLEAN--standaloneProduce a complete standalone document.

Showing key inputs. pandoc exposes 5 inputs in total.

Full flag reference (5 inputs)
NameTypeFlagDescription
inputFILE--inputInput document file
fromSTRING--fromInput format such as markdown, html, or docx
toSTRING--toOutput format such as html, markdown, docx, or epub
templateFILE--templatePandoc template file
standaloneBOOLEAN--standaloneProduce a standalone document with header and footer

example

Run pandoc

pandoc · command
pandoc input.md --from markdown --to html --standalone --output output.html
sample output
<h1 id="batch-proof">Batch proof</h1><p>Pandoc works.</p>

guidance

Choosing pandoc

Use Pandoc for semantic conversion between structured text and document formats. Use LibreOffice when office-suite rendering fidelity matters.

libreoffice

Renders office documents and exports them through LibreOffice filters.

weasyprint

Turns HTML and CSS into paginated PDF output.

pdftotext

Extracts text from an existing PDF instead of creating one.

faq

pandoc questions

It can infer many formats from the input, or you can set --from explicitly.

Run pandoc yourself

A Markdown fixture is converted into a standalone HTML document and checked for its expected heading and paragraph.

Facts on this page come from the live Trickest tool library.