Available Output Formats in Mathpix Python SDK
With the Mathpix Python SDK you can convert images, PDFs, or Mathpix Markdown (MMD) into a variety of formats and download the results locally.
Supported Output Formats
Format | Quick link to spec | What you get |
---|---|---|
docs.mathpix.com › PDF | A vector PDF of the rendered document | |
docx | docs.mathpix.com › DOCX | A Microsoft Word file with styled text, math, and images |
md | docs.mathpix.com › Markdown | Plain UTF‑8 Markdown for any Markdown editor |
mmd | docs.mathpix.com › MMD | Mathpix Markdown — extended Markdown with LaTeX math |
html | docs.mathpix.com › HTML | A self‑contained HTML page ready for the web |
json | docs.mathpix.com › JSON | A structured JSON tree of every OCR element |
End‑to‑end Example – request two formats and download them
from mpxpy.mathpix_client import MathpixClient
client = MathpixClient(
app_id="your-app-id",
app_key="your-app-key"
)
# Send the conversion request (here we convert MMD → PDF + Markdown)
conversion = client.conversion_new(
mmd="E = mc^2",
formats={"pdf": True, "md": True}
)
# Wait until the conversion finishes
conversion.wait_until_complete(timeout=30)
# Download the generated files
pdf_path = conversion.download_output_to_local_path("pdf", "./output")
md_path = conversion.download_output_to_local_path("md", "./output")
After running this script, two files will be created in the
./output
folder:cnv_YYYY_MM_DD_xxxxx.pdf
– the formatted PDF output.cnv_YYYY_MM_DD_xxxxx.md
– the plain Markdown output.
You can request other output formats the same way, depending on your conversion type.
The available formats depend on the type of conversion:
- Not all output formats are available for every input type.
- For detailed examples of each output format, visit docs.mathpix.com and explore the relevant sections.