Skip to main content
MarkItDown supports various additional file formats for data, archives, and structured documents.

Supported Formats

CSV

Comma-separated values

JSON

JSON and JSONL files

XML

XML documents via RSS parser

ZIP

Archive file contents

EPUB

E-book format

Jupyter

IPython notebooks

CSV Files

Dependencies

No external dependencies - uses Python’s built-in csv module.

Features

  • Converts CSV to Markdown tables
  • First row treated as header
  • Automatic encoding detection with charset-normalizer
  • Handles irregular row lengths

Usage

Example

Input CSV:
Output Markdown:

Implementation

  • Converter Class: CsvConverter (_csv_converter.py)
  • Accepted Extensions: .csv
  • MIME Types: text/csv, application/csv
  • Encoding: Uses charset-normalizer if charset not specified

JSON Files

Dependencies

No external dependencies - uses Python’s built-in json module.

Features

  • Plain text output (not converted to structured Markdown)
  • Preserves JSON formatting
  • Supports both .json and .jsonl files

Usage

Implementation

  • Converter Class: PlainTextConverter (_plain_text_converter.py)
  • Accepted Extensions: .json, .jsonl
  • MIME Types: application/json
  • Processing: Treated as plain text, no special JSON parsing
JSON files are processed as plain text. For structured JSON-to-Markdown conversion, consider pre-processing with jq or a custom script.

XML Files

Dependencies

Features

  • XML files are processed by the RSS converter
  • Only RSS/Atom feeds are specially formatted
  • Other XML treated as plain text

Usage

Implementation

  • RSS/Atom XML: RssConverter (_rss_converter.py) - see Web Content
  • Other XML: PlainTextConverter (_plain_text_converter.py)

ZIP Archives

Dependencies

No external dependencies - uses Python’s built-in zipfile module.

Features

  • Extracts and converts each file in the archive
  • Recursively processes nested files
  • Skips unsupported formats silently
  • Preserves file paths in output

Usage

Output Format

Implementation

  • Converter Class: ZipConverter (_zip_converter.py)
  • Accepted Extensions: .zip
  • MIME Types: application/zip
  • Processing: Each file converted independently using appropriate converter

Advanced Example

EPUB Books

Dependencies

Features

  • Extracts book metadata (title, authors, publisher, etc.)
  • Converts chapters in reading order
  • Preserves chapter structure
  • Handles XHTML content

Usage

Output Format

Implementation

  • Converter Class: EpubConverter (_epub_converter.py)
  • Accepted Extensions: .epub
  • MIME Types: application/epub, application/epub+zip, application/x-epub+zip
  • Processing:
    1. Extract META-INF/container.xml to find content.opf
    2. Parse metadata from content.opf
    3. Read spine order from content.opf
    4. Convert each chapter (XHTML) to Markdown
    5. Combine with metadata

Metadata Fields

Jupyter Notebooks

Dependencies

No external dependencies - uses Python’s built-in json module.

Features

  • Converts .ipynb files to Markdown
  • Preserves code cells in code blocks
  • Includes markdown cells directly
  • Extracts first H1 heading as title
  • Handles raw cells

Usage

Output Format

Input Notebook:
Output Markdown:

Results

The analysis shows…

Plain Text Files

Dependencies

No external dependencies.

Features

  • Supports .txt, .text, .md, .markdown extensions
  • Automatic encoding detection
  • Preserves content as-is

Usage

Implementation

  • Converter Class: PlainTextConverter (_plain_text_converter.py)
  • Accepted Extensions: .txt, .text, .md, .markdown, .json, .jsonl
  • MIME Types: text/*, application/json, application/markdown
  • Encoding: Uses charset-normalizer if charset not specified

Comparison Table

Common Patterns

Processing Archive Contents

CSV to Formatted Report

Book Chapter Extraction

Error Handling

Source Code Reference

Next Steps

Format Overview

See all supported formats

Python API

Learn the programmatic interface