Skip to main content
MarkItDown provides specialized converters for various web content types, extracting meaningful content while removing navigation, ads, and other non-essential elements.

Supported Formats

HTML Pages

Generic HTML documents and web pages

RSS/Atom Feeds

News feeds and blog syndication

Wikipedia

Wikipedia articles with clean extraction

YouTube

Video metadata and transcripts

Bing Search

Bing search results pages

HTML Pages

Dependencies

Features

  • Extracts main content from <body> tag
  • Removes <script> and <style> blocks
  • Converts HTML elements to Markdown equivalents
  • Preserves links, images, tables, and formatting
  • Extracts page title from <title> tag

Usage

Implementation

  • Converter Class: HtmlConverter (_html_converter.py)
  • Accepted Extensions: .html, .htm
  • MIME Types: text/html, application/xhtml
  • Markdown Engine: Custom _CustomMarkdownify based on markdownify library

RSS/Atom Feeds

Dependencies

Features

  • Supports both RSS 2.0 and Atom 1.0 formats
  • Extracts feed title and description
  • Converts each item/entry to a section
  • Parses HTML content within feed items
  • Preserves publication dates

Usage

Output Format

RSS Feed:
Atom Feed:

Implementation

  • Converter Class: RssConverter (_rss_converter.py)
  • Accepted Extensions: .rss, .atom, .xml
  • MIME Types: application/rss+xml, application/atom+xml, text/xml
  • Detection: Checks for <rss> or <feed> root elements
  • XML Parser: defusedxml.minidom (secure XML parsing)

Wikipedia

Dependencies

Features

  • Extracts main article content only
  • Removes navigation, sidebars, and infoboxes
  • Preserves article structure and formatting
  • Includes article title as H1 heading
  • Works with any language Wikipedia

Usage

Output Format

Implementation

  • Converter Class: WikipediaConverter (_wikipedia_converter.py)
  • URL Pattern: https?://[a-z]{2,3}.wikipedia.org/
  • Content Selector: <div id="mw-content-text">
  • Title Selector: <span class="mw-page-title-main">

YouTube

Dependencies

Features

  • Extracts video title and description
  • Retrieves video metadata (views, keywords, duration)
  • Downloads video transcript in multiple languages
  • Falls back gracefully if transcript unavailable

Usage

Output Format

Implementation

  • Converter Class: YouTubeConverter (_youtube_converter.py)
  • URL Pattern: https://www.youtube.com/watch?v=*
  • Metadata Source: Meta tags and ytInitialData JSON
  • Transcript API: youtube-transcript-api library
  • Languages: Defaults to ["en"], customizable via youtube_transcript_languages

Transcript Options

The converter will:
  1. Try to fetch transcript in first language (Spanish)
  2. Fall back to second language (French) if unavailable
  3. Fall back to third language (English) if unavailable
  4. Attempt auto-translation if no direct transcript exists

Bing Search Results

Dependencies

Features

  • Extracts organic search results
  • Removes ads and navigation
  • Decodes Bing redirect URLs to actual destination URLs
  • Preserves result snippets and links
Better Alternative: Using the Bing Search API directly is recommended over scraping. This converter is provided for convenience but may break if Bing changes their HTML structure.

Usage

Output Format

Implementation

  • Converter Class: BingSerpConverter (_bing_serp_converter.py)
  • URL Pattern: https://www.bing.com/search?q=*
  • Result Selector: Elements with class b_algo
  • URL Decoding: Base64 decodes redirect URLs from u parameter

Common Patterns

Fetching Web Content

Processing Multiple URLs

Error Handling

Implementation Notes

Converter Priority

MarkItDown checks converters in this order for web content:
  1. WikipediaConverter - Checks URL matches Wikipedia domain
  2. YouTubeConverter - Checks URL matches YouTube watch page
  3. BingSerpConverter - Checks URL matches Bing search
  4. RssConverter - Checks for RSS/Atom root elements
  5. HtmlConverter - Generic fallback for all HTML

Source Files

Next Steps

Other Formats

CSV, JSON, XML, ZIP, EPUB, Jupyter notebooks

Python API

Learn more about the programmatic interface