> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markpdf.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Conversion modes

> How to choose between fast, balanced, quality and auto.

# Conversion modes

The `mode` parameter controls the balance between speed and fidelity.

<CardGroup cols={2}>
  <Card title="fast" icon="bolt">
    Recommended default for most documents and AI-agent pipelines.
  </Card>

  <Card title="balanced" icon="scale-balanced">
    Better structure for irregular layouts, tables and mixed document content.
  </Card>

  <Card title="quality" icon="gem">
    Slower best-effort mode for difficult documents where structure matters more than speed.
  </Card>

  <Card title="auto" icon="wand-magic-sparkles">
    Starts fast and uses a stronger path only when the first result is too lean.
  </Card>
</CardGroup>

## When to use each

| Document                                  | Suggested mode |
| ----------------------------------------- | -------------- |
| Regular PDFs, reports and contracts       | `fast`         |
| Tables or irregular layout                | `balanced`     |
| Difficult document failing in other modes | `quality`      |
| You do not know what to expect            | `auto`         |

## Non-PDF formats

For CSV, TXT, DOCX, XLSX, PPTX and HTML, `mode` usually has little effect. Each format follows the best available conversion path for that file type.

## Cleaning

Regardless of mode, `clean=true` by default normalizes Markdown, collapses excess line breaks, removes control lines and reduces repeated headers.
