Welcome to Turndown
Turndown is a JavaScript library that converts HTML to Markdown. It’s designed to be fast, flexible, and extensible, supporting both browser and Node.js environments.Quick Start
Get up and running with Turndown in minutes
API Reference
Explore the complete API documentation
Custom Rules
Learn how to extend Turndown with custom rules
Plugins
Add functionality with the plugin system
Key Features
CommonMark Support
Full support for the CommonMark specification
Highly Configurable
Control heading styles, code blocks, delimiters, and more
Extensible Rules
Add custom rules to handle any HTML element
Plugin System
Extend functionality with reusable plugins
Cross-Platform
Works in both browser and Node.js environments
Lightweight
Minimal dependencies, maximum performance
Quick Example
Here’s a simple example of converting HTML to Markdown:Use Cases
Turndown is perfect for:- Content Migration: Convert existing HTML content to Markdown
- Web Scraping: Extract clean Markdown from web pages
- Rich Text Editors: Convert WYSIWYG editor output to Markdown
- Documentation Tools: Transform HTML documentation to Markdown format
- Email Processing: Convert HTML emails to readable Markdown
Browser and Node.js Support
Turndown works seamlessly in both environments:- Node.js
- Browser
Next Steps
Install Turndown
Install the package via npm, yarn, or pnpmGo to Installation
Try the Quickstart
Learn the basics with a hands-on tutorialGo to Quickstart
Explore the API
Dive deep into all available methods and optionsGo to API Reference