Markdown to HTML Converter, Sanitized & Safe
Pricing
from $0.70 / 1,000 documents converted
Markdown to HTML Converter, Sanitized & Safe
Converts Markdown to clean, sanitized HTML: texts, file URLs or Apify dataset columns. GFM tables, task lists, footnotes, code blocks, heading ids, optional table of contents, safe links. Failed documents are free; empty input runs a free demo.
Pricing
from $0.70 / 1,000 documents converted
Rating
0.0
(0)
Developer
Actor Factory
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
6 days ago
Last modified
Categories
Features
Share
Convert Markdown into clean, safe HTML, one row per document (source, html, title, headings, wordCount, tocHtml, error). Give it Markdown texts, links to .md files or a column of an Apify dataset. Tables, code blocks, task lists and footnotes become HTML; headings get ids; a table of contents is one switch away; scripts and unsafe links are removed. No browser, no LLM, no API key.
Try it free: leave the input empty and press Start. The demo converts two sample documents and is not charged (rows carry _demo: true). The second sample contains a <script> tag and a javascript: link, so you can see what the sanitizer does.
Who this is for
- You write in Markdown and publish somewhere that wants HTML: blog posts, help-center articles, release notes, a CMS or a newsletter tool with an HTML box. Convert a whole folder's worth of files in one run instead of pasting them one by one.
- You have Markdown from a model or from users: AI answers, comments, support replies, form input. Turning that into HTML and putting it on a page is only safe if the HTML is cleaned first. The sanitizer is on by default.
- You build pages or documents from a dataset: another Actor produced a
markdowncolumn and you needhtmlnext to it, with a title and a table of contents for each row.
What you get
| source | title | html (shortened) | wordCount |
|---|---|---|---|
| sample-release-notes.md | Release notes | <h1 id="release-notes">Release notes</h1> ... <table> ... | 37 |
| sample-untrusted-input.md | Untrusted input | <p>This text came from a form ...</p> (no script, no handler) | 27 |
| https://example.com/missing.md | 0 (error http_404) |
- GitHub-style Markdown: tables with alignment,
strikethrough, task lists (- [x]), footnotes ([^1]), fenced code blocks with the language kept asclass="language-python" - Heading ids: every heading gets an id made from its text (
getting-started; Japanese headings keep their characters; repeated headings get-1,-2) - Table of contents: a nested list with working links in
tocHtml, up to the depth you choose, and optionally also placed at the top ofhtml - Sanitizing (on by default): only a safe list of tags, attributes and link types is kept.
<script>,<style>,<iframe>, forms,on...handlers,javascript:anddata:links are removed - Links: optional
target="_blank"for external links, andrel="noopener noreferrer"(on by default) - Row fields:
titleis the first heading,headingslists level, text and id of every heading,wordCountcounts words (characters for Japanese, Chinese and Korean text) - Three inputs, mixable in one run: Markdown texts, file URLs, datasets
Price
$1.00 per 1,000 documents ($0.001 per converted document). 1,000 documents cost $1.00, 5,000 cost $5.00.
On the Apify Free plan, the $5 of monthly platform credit covers about 5,000 documents.
Only successful conversions are charged. Failed documents (404, timeout, too large, missing field), empty documents and the demo are free.
Set a maximum cost per run to cap spend: when it is reached the run stops cleanly and does not write the rest. The status message and the STATS record (stoppedAtChargeLimit: true) say so. If the maximum is lower than the price of one document, the run fails at the start and nothing is converted or charged.
Input
{"markdownTexts": ["# Hello\n\nThis is **Markdown**."],"fileUrls": ["https://example.com/docs/intro.md"],"datasetIds": ["WkzbQMuFYuamGv3YF"],"markdownField": "markdown","toc": true,"tocDepth": 3,"sanitize": true,"linkTargetBlank": true}
| Field | Default | Meaning |
|---|---|---|
markdownTexts | Markdown documents, one string each | |
fileUrls | Public links to .md or plain-text files | |
datasetIds | Datasets whose items hold Markdown (a Console dataset URL works too) | |
markdownField | markdown | Field holding the Markdown in a dataset item (a.b for nested) |
gfm | on | Tables, strikethrough, task lists, footnotes |
toc / tocDepth / prependToc | off / 3 / off | Table of contents, its deepest level, and whether to also put it at the top of the HTML |
headingIds | on | Ids on headings (always on with toc) |
sanitize | on | Remove everything unsafe |
allowRawHtml | on | Keep HTML tags written inside the Markdown (safe ones, when sanitizing) |
linkTargetBlank | off | New tab for external links |
addNoopener | on | rel="noopener noreferrer" |
lineBreaks | off | A single line break becomes <br> |
Leave texts, file URLs and datasets all empty for the free demo.
Output
One dataset row per document:
{"source": "text#0","html": "<h1 id=\"hello\">Hello</h1>\n<p>This is <strong>Markdown</strong>.</p>\n","title": "Hello","headings": [{"level": 1, "text": "Hello", "id": "hello"}],"wordCount": 4,"tocHtml": "<nav class=\"toc\"><ul><li><a href=\"#hello\">Hello</a></li></ul></nav>","error": null}
source is text#N (position in your list), the file URL, or dataset:ID#N (item number). A failed document has an empty html and an error such as http_404, timeout, blocked_private_address, document_too_large, empty_document or missing_markdown_field: markdown. A STATS record in the key-value store counts converted, failed (by reason) and charged documents.
FAQ
What exactly does sanitizing remove? Everything outside a safe list. Scripts, styles, iframes, forms, event-handler attributes (onclick, onerror), javascript: and data: links, and unknown attributes are dropped. Kept: normal text structure, links (http, https, mailto, tel and relative), images, tables, code, lists, footnotes and task-list checkboxes (always disabled). A Markdown link such as [x](javascript:...) is not turned into a link at all; it stays as plain, harmless text. Sanitizing is a safety net for text you did not write yourself. It is not a promise about the content of the links.
Should I turn sanitizing off? Only for Markdown you wrote and trust, when you need HTML the safe list does not allow. With it off, the HTML is passed through exactly as written, scripts included. Never turn it off for AI output, comments or any other outside text.
Which Markdown is supported? CommonMark plus tables, strikethrough, task lists and footnotes (switch gfm off for plain CommonMark). Bare URLs in a sentence are not turned into links automatically: write [text](url) or <url>. Math, diagrams, emoji shortcodes and syntax highlighting colors are not included; code blocks come out as <pre><code class="language-..."> for the highlighter of your site.
How does the table of contents work? Turn on toc. Each row gets tocHtml, a nested list of links to the heading ids, down to tocDepth. Set prependToc to also have it at the top of html. Documents without headings get an empty tocHtml.
What are the limits? 5,000 documents per run and 2 MB per document, fixed and not changeable in the input. A file is downloaded up to 50 MB and then counts as one document (so it must be 2 MB or less). Each URL is fetched with a 30-second timeout and retried up to 3 times on connection errors, timeouts and server errors (not on 404). Links to internal or private addresses are refused. More than 5,000 inputs: the first 5,000 are processed and the run says so.
What does it cost? $0.001 per converted document, nothing for failures and the demo. See Price above.
Which character encodings work for files? UTF-8 (with or without BOM) first, then the charset the server announces (for example Shift_JIS), otherwise UTF-8 with replacement characters.
Is my data stored? No. Texts, files and datasets are read, converted and written to your own run's dataset. Only the URLs you give are fetched, one request per file, and nothing is crawled.
Notes
Fetch only files you are allowed to read. You are responsible for the rights to the documents you convert and for the sites you point the Actor at.
More tools from the same developer
- HTML to Markdown Converter, LLM and RAG — clean Markdown from URLs, raw HTML or datasets for LLM and RAG
- DOCX to Markdown — Word .docx URLs to Markdown and plain text, with headings and tables
- RAG Chunker — split scraped pages into chunks for RAG and vector stores
- HTML to PDF API — HTML strings or public URLs to PDF: A4 / Letter, margins, header, footer, page numbers
- Website to Markdown Crawler for RAG and LLMs — crawl a website and get every page as clean Markdown for RAG and LLMs, robots.txt respected, optional chunks