Markdown ↔ HTML Converter
Pricing
Pay per event
Markdown ↔ HTML Converter
Convert Markdown to HTML and HTML to Markdown in both directions. Bulk conversion, GFM tables/strikethrough/task lists, HTML sanitization, and auto-detect. No login needed.
Pricing
Pay per event
Rating
0.0
(0)
Developer
Stas Persiianenko
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 hours ago
Last modified
Categories
Share
Convert Markdown to HTML and HTML to Markdown — in both directions, in bulk. Supports GitHub Flavored Markdown (GFM) including tables, strikethrough, and task lists. No API key or login required.
What does Markdown ↔ HTML Converter do?
Markdown ↔ HTML Converter is a developer utility that converts documents between Markdown and HTML format. Give it Markdown and get back clean, structured HTML. Give it HTML and get back readable, clean Markdown. The actor handles bulk conversion — feed it dozens or hundreds of documents in a single run and get all results in a structured dataset.
The tool uses the industry-standard marked library (30M+ weekly downloads) for Markdown→HTML conversion and turndown for HTML→Markdown. Both libraries are production-tested and widely trusted. GitHub Flavored Markdown extensions (tables, strikethrough, task lists, heading IDs) are enabled by default.
Auto-detection mode figures out which direction to convert based on content analysis — you don't need to specify the direction for mixed batches.
Who is Markdown ↔ HTML Converter for?
🧑💻 Backend developers and DevOps engineers
- Convert documentation stored as Markdown to HTML for web rendering
- Strip HTML from CMS exports before storing in databases
- Batch-process legacy HTML content into Markdown for version-controlled docs
- Automate content pipeline transformations via API or Zapier
📝 Content teams and technical writers
- Convert blog posts between formats for different publishing platforms
- Migrate content from HTML-based CMS (WordPress, Drupal) to Markdown-based systems (Hugo, Jekyll, Ghost)
- Clean up HTML exported from Word/Google Docs into readable Markdown
- Maintain a consistent Markdown source of truth across documentation systems
🔧 Data engineers and automation specialists
- Bulk-convert thousands of scraped HTML pages into Markdown for LLM training datasets
- Transform Markdown README files into HTML for display in internal dashboards
- Pre-process content for embedding into AI pipelines
- Run scheduled conversions as part of ETL workflows
📊 AI/ML teams
- Prepare training data by converting HTML web pages to clean Markdown
- Extract structured text from HTML for RAG (Retrieval-Augmented Generation) pipelines
- Clean noisy HTML into readable Markdown before embedding into vector stores
- Convert LLM-generated Markdown outputs to HTML for user-facing rendering
Why use Markdown ↔ HTML Converter?
- ✅ Both directions — Markdown→HTML and HTML→Markdown in the same tool
- ✅ Auto-detect — no need to specify direction for mixed batches
- ✅ Bulk conversion — process arrays of documents in a single run
- ✅ GFM support — GitHub Flavored Markdown tables, strikethrough, task lists, heading IDs
- ✅ HTML sanitization — optional XSS protection for browser-rendered output
- ✅ No login required — no API key, no account, no setup
- ✅ Structured output — results in dataset with label, mode, lengths, and previews
- ✅ API-first — automate via Apify API, Zapier, Make, or scheduled runs
- ✅ Pay-per-conversion — pay only for what you convert, no monthly fee
What data can you extract?
Each conversion result contains:
| Field | Type | Description |
|---|---|---|
label | string | Item label (from input) or index number |
mode | string | Conversion performed: mdToHtml or htmlToMd |
input | string | First 200 characters of the input text |
output | string | First 200 characters of the converted output |
inputLength | number | Character count of input |
outputLength | number | Character count of output |
error | string|null | Error message if conversion failed, null on success |
How much does it cost to convert Markdown and HTML?
This Actor uses pay-per-event pricing — you pay only for what you convert. No monthly subscription. All platform costs are included.
| Free | Starter ($29/mo) | Scale ($199/mo) | Business ($999/mo) | |
|---|---|---|---|---|
| Per conversion | $0.00115 | $0.001 | $0.00078 | $0.0006 |
| 1,000 conversions | $1.15 + $0.01 start | $1.00 + $0.01 start | $0.78 + $0.01 start | $0.60 + $0.01 start |
Higher-tier plans get additional volume discounts (up to 72% off for enterprise).
Real-world cost examples:
| Task | Documents | Cost (Free tier) |
|---|---|---|
| Convert a batch of blog posts | 50 docs | ~$0.07 |
| Bulk-convert a documentation site | 500 docs | ~$0.58 |
| Prepare LLM training data | 5,000 docs | ~$5.76 |
Free plan: Apify gives you $5 in free credits to start. That covers ~4,300 conversions on the free tier.
How to convert Markdown to HTML (or HTML to Markdown)
- Go to Markdown ↔ HTML Converter on Apify Store.
- Click Try for free.
- In the Input Documents field, add your documents as a JSON array. Each item should have a
textfield (required) and optionally alabelfield. - Select the Conversion mode —
autodetects direction automatically, or choosemdToHtml/htmlToMdexplicitly. - Toggle GFM on (default) to enable GitHub Flavored Markdown tables, strikethrough, and task lists.
- Toggle Sanitize HTML on if the output will be rendered in a browser (removes
<script>,<iframe>, etc.). - Click Start and wait a few seconds.
- Download your results from the Dataset tab as JSON, CSV, or Excel.
Example input — convert Markdown to HTML:
{"mode": "mdToHtml","gfm": true,"inputs": [{"label": "my-readme","text": "# My Project\n\nA **great** project with [docs](https://example.com).\n\n## Features\n\n- Fast\n- Reliable\n- Open source"}]}
Example input — convert HTML to Markdown:
{"mode": "htmlToMd","inputs": [{"label": "homepage","text": "<h1>My Project</h1><p>A <strong>great</strong> project with <a href=\"https://example.com\">docs</a>.</p>"}]}
Example input — auto-detect, bulk conversion:
{"mode": "auto","gfm": true,"sanitize": true,"inputs": [{"label": "md-doc","text": "# Title\n\nMarkdown **content** here."},{"label": "html-doc","text": "<h1>Title</h1><p>HTML <strong>content</strong> here.</p>"}]}
Input parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
inputs | array | required | Array of objects with text (required) and label (optional) fields |
mode | string | "auto" | Conversion direction: "auto" (detect), "mdToHtml", or "htmlToMd" |
gfm | boolean | true | Enable GitHub Flavored Markdown (tables, strikethrough, task lists, heading IDs) |
sanitize | boolean | false | Strip unsafe HTML tags (<script>, <iframe>, etc.) from HTML output |
mode values:
| Value | Behavior |
|---|---|
auto | Detect direction based on HTML tag presence in content |
mdToHtml | Force Markdown → HTML for all items |
htmlToMd | Force HTML → Markdown for all items |
Output examples
Markdown → HTML result:
{"label": "readme","mode": "mdToHtml","input": "# Hello World\n\nThis is **bold** text.","output": "<h1 id=\"hello-world\">Hello World</h1>\n<p>This is <strong>bold</strong> text.</p>","inputLength": 37,"outputLength": 79,"error": null}
HTML → Markdown result:
{"label": "page","mode": "htmlToMd","input": "<h1>Hello World</h1><p>This is <strong>bold</strong> text.</p>","output": "# Hello World\n\nThis is **bold** text.","inputLength": 62,"outputLength": 37,"error": null}
GFM table conversion — Markdown → HTML:
{"label": "table-doc","mode": "mdToHtml","input": "| Name | Score |\n|------|-------|\n| Alice | 95 |","output": "<table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Score</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Alice</td>\n<td>95</td>\n</tr>\n</tbody>\n</table>","inputLength": 47,"outputLength": 125,"error": null}
Tips for best results
- 🔬 Start small — test with 5-10 documents before running bulk batches to verify the output matches your expectations.
- 🏷️ Use labels — add
labelfields to your input items for easy identification in the dataset (the output preserves them). - 🔄 Use auto mode for mixed batches — when converting a mix of HTML and Markdown,
automode handles each item independently. - 🛡️ Enable sanitize for browser rendering — if you're converting Markdown to HTML for direct browser display (e.g., user-generated content), turn on
sanitize: trueto strip XSS vectors. - 📐 GFM on by default — GitHub Flavored Markdown is enabled by default and handles most common Markdown variants including CommonMark. Disable only if you need strict original Markdown behavior.
- 📦 Batch efficiently — you can include hundreds of documents in a single
inputsarray. The actor processes them sequentially and outputs one dataset item per conversion. - 🔗 Preserve labels for traceability — when processing a document management system, use file paths or document IDs as labels (e.g.,
"label": "docs/api-reference.md"). - ⚡ Schedule daily runs — if you have a pipeline that ingests HTML content and needs to produce Markdown periodically, use Apify's scheduler to automate it.
Integrations
📊 Markdown ↔ HTML Converter → Google Sheets Push conversion results directly to a Google Sheet via Apify's Google Sheets integration. Use case: a content team tracks all Markdown→HTML transformations for their blog pipeline in a shared spreadsheet.
🤖 Markdown ↔ HTML Converter → OpenAI / LangChain (via Zapier/Make) After converting HTML pages to Markdown, pipe the clean Markdown to an LLM for summarization or classification. Markdown is much cleaner input for language models than raw HTML.
📧 Markdown ↔ HTML Converter → Slack/Discord alerts Trigger a webhook when bulk conversions complete. Useful for teams running nightly pipelines that need to know when new HTML→Markdown output is ready for review.
🔁 Scheduled conversions via Apify Scheduler Run the converter on a schedule (daily, weekly) to keep your Markdown documentation in sync with upstream HTML sources. No manual work needed.
📁 Markdown ↔ HTML Converter → S3 / Google Cloud Storage Via Apify webhooks, automatically push converted documents to cloud storage as soon as a run finishes. Integrate with your CI/CD or content delivery pipeline.
🔗 Make / Zapier automation Use the Apify trigger ("Run succeeded") in Zapier or Make to start a downstream workflow whenever the converter finishes a batch — route output to CMS, databases, or email.
Using the Apify API
You can trigger runs, retrieve datasets, and integrate with any programming language using the Apify API.
Node.js
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });const run = await client.actor('automation-lab/markdown-html-converter').call({mode: 'mdToHtml',gfm: true,inputs: [{ label: 'readme', text: '# Hello\n\nThis is **bold** text.' },{ label: 'guide', text: '## Getting Started\n\n- Step 1\n- Step 2' },],});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
Python
from apify_client import ApifyClientclient = ApifyClient(token="YOUR_APIFY_TOKEN")run = client.actor("automation-lab/markdown-html-converter").call(run_input={"mode": "mdToHtml","gfm": True,"inputs": [{"label": "readme", "text": "# Hello\n\nThis is **bold** text."},{"label": "guide", "text": "## Getting Started\n\n- Step 1\n- Step 2"},],})items = client.dataset(run["defaultDatasetId"]).list_items().itemsprint(items)
cURL
curl -X POST "https://api.apify.com/v2/acts/automation-lab~markdown-html-converter/runs" \-H "Authorization: Bearer YOUR_APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"mode": "mdToHtml","gfm": true,"inputs": [{"label": "readme", "text": "# Hello\n\nThis is **bold** text."},{"label": "guide", "text": "## Getting Started\n\n- Step 1\n- Step 2"}]}'
Then fetch results from the dataset:
curl "https://api.apify.com/v2/datasets/{DATASET_ID}/items" \-H "Authorization: Bearer YOUR_APIFY_TOKEN"
Use with AI agents via MCP
Markdown ↔ HTML Converter is available as a tool for AI assistants that support the Model Context Protocol (MCP).
Add the Apify MCP server to your AI client — this gives you access to all Apify actors, including this one:
Setup for Claude Code
$claude mcp add --transport http apify "https://mcp.apify.com"
Setup for Claude Desktop, Cursor, or VS Code
Add this to your MCP config file:
{"mcpServers": {"apify": {"url": "https://mcp.apify.com"}}}
Your AI assistant will use OAuth to authenticate with your Apify account on first use.
Example prompts
Once connected, try asking your AI assistant:
- "Use automation-lab/markdown-html-converter to convert these 3 Markdown files to HTML with GFM tables enabled"
- "Convert this HTML blog post to clean Markdown so I can store it in my docs repo"
- "Bulk-convert my array of HTML snippets to Markdown and return the results as JSON"
Learn more in the Apify MCP documentation.
Is it legal to use this converter?
Yes. This actor performs format conversion on content you provide — it does not scrape any website, access any third-party API, or download any external data. You are responsible for ensuring you have the rights to the content you submit for conversion.
The actor is a pure text transformation utility. It runs on Apify's infrastructure and processes your input data only. No content is stored beyond the run's dataset (which you own and can delete at any time).
For GDPR compliance, Apify is a GDPR-compliant platform. Data submitted in actor runs is processed as described in the Apify Privacy Policy.
FAQ
How fast is the conversion?
Very fast. Each document is converted in milliseconds using in-memory JavaScript libraries. A batch of 100 documents typically finishes in 2-5 seconds. A batch of 1,000 documents usually completes in under 30 seconds.
How much does it cost to convert 10,000 documents?
At the Free tier: ~$11.51 ($0.01 start + 10,000 × $0.00115). At the Starter tier ($29/mo): ~$10.01. Scale and Business plan users get additional volume discounts. The actor uses pay-per-event pricing with no monthly fee.
How does auto-detection work?
The auto-detect mode analyzes each document independently. If the text contains HTML tags (like <div>, <p>, <h1>, <ul>, <table>, etc.), it treats the input as HTML and converts it to Markdown. Otherwise it assumes Markdown input and converts to HTML. You can always override this by setting mode to mdToHtml or htmlToMd explicitly.
Why is my HTML output missing some tags?
If sanitize is set to true, the actor strips potentially unsafe tags including <script>, <iframe>, <object>, <embed>, <form>, and <link>, as well as inline event handlers (e.g., onclick). If you need those tags preserved, set sanitize: false (the default).
Why is my Markdown table not converting to HTML correctly?
Make sure gfm is set to true (the default). GFM tables require the | separator syntax. Standard Markdown does not support tables — they are a GitHub Flavored Markdown extension.
Why does the output field only show 200 characters?
The input and output fields in the dataset are previews truncated at 200 characters. This keeps the dataset table readable. The full content is not stored in the dataset — the actor is designed for pipeline use where you process content inline rather than storing large documents in Apify datasets. If you need full content storage, use a key-value store in your downstream pipeline.
Can I convert very large documents?
Yes, but keep actor memory in mind. The default 256 MB memory handles documents up to several hundred KB each. For very large documents (multi-MB), consider splitting them into sections before submitting, or contact Apify support to increase memory allocation.
Other developer tools on Apify
Looking for more utility actors?
- Base64 Converter — Encode and decode Base64 strings in bulk
- Broken Link Checker — Find broken links on any website
- Canonical URL Checker — Validate canonical tags and detect SEO issues
- Accessibility Checker — Audit pages for WCAG accessibility issues
- Robots & Sitemap Analyzer — Analyze robots.txt and sitemaps
- Website Uptime Checker — Monitor website availability
- DMARC Record Checker — Validate DMARC DNS records
- SPF Record Checker — Validate SPF DNS records