HTML to Markdown Converter
Convert HTML to Markdown in your browser. Upload a file or select specific sections, then export tables, code and optional front matter.
Still loading. If the tool doesn’t appear, reload this page.
About this tool
HTML to Markdown Converter
Convert HTML into clean Markdown with GFM tables, links, images, and code blocks.
To convert HTML to Markdown, paste the HTML and copy or download the Markdown: Turndown with GitHub-flavoured Markdown support runs in your browser, so nothing is uploaded and no account is needed. Scripts, iframes, styles, comments and event handlers are stripped first, tables become GFM pipe tables, and fenced code blocks keep their language tag.
How to use HTML to Markdown Converter
Paste HTML into the input box, upload an .html file, or click Load Sample to try it with a realistic document.
Adjust the conversion settings — heading style, bullet marker, code fence, GFM tables, front matter, cleanup toggles — and the Markdown regenerates automatically.
Check the result in the Markdown, Preview or Clean HTML tab, then copy it to your clipboard or download it as a .md file.
Why use HTML to Markdown Converter
Tables and code survive the conversion
The turndown-plugin-gfm extension writes <table> markup as GitHub-flavored pipe tables, and a custom rule pulls the language name out of class="language-js" so fenced blocks come out as ```js rather than untagged.
Sanitised before it converts
Scripts, noscript, iframes, objects, embeds, stylesheets, HTML comments and every on* event-handler attribute are removed from the parsed DOM first. You can inspect exactly what was kept in the Clean HTML tab.
The output style is yours
Choose ATX or Setext headings, inline or reference links, -, * or + bullets, ``` or ~~~ fences, hard line breaks on or off, and whether links and images are kept or flattened to text.
Client-side parsing and .md download
Parsing, conversion, preview and the .md download all run client-side — uploaded files are read with the File API and the download is built from a local Blob. There is no server round-trip, no signup and no usage limit.
Common use cases
- Move article or CMS-exported HTML into a Markdown docs site or static-site generator, with YAML front matter added on the way out.
- Turn a scraped or saved web page into a clean README or documentation page without hand-rebuilding its tables and code blocks.
- Strip rich-text HTML from an email, Google Doc or WYSIWYG editor down to plain Markdown for notes, issue trackers or LLM prompts.
Frequently asked questions
How do I convert HTML to Markdown?
Paste your HTML into the input box, or upload an .html, .htm or .txt file. Conversion runs automatically 250 ms after you stop typing, so the Markdown appears without pressing anything — then copy it or click Download .md. There is also a Convert Now button if you want to force a re-run.
Link to answerCan I convert only part of an HTML page to Markdown?
Enter a CSS selector such as main, article or #content in Content selector. The converter uses the matching elements inside the HTML body and includes nested matches only once. Leave the field blank to convert the whole body.
Link to answerDoes it keep HTML tables as Markdown tables?
Yes. The GitHub tables toggle is on by default and applies turndown-plugin-gfm, which converts <table> into a GFM pipe table with a header separator row. Turn that toggle off and the plugin is not loaded, so table markup collapses to its plain text content — leave it on unless you specifically want that.
Link to answerIs my HTML uploaded to a server?
No. The DOMParser clean-up pass and the Turndown conversion both run in your browser, uploaded files are read locally with the File API's text() method, and the .md download is generated from an in-memory Blob. Your markup never reaches AltFTool's servers.
Link to answerCan I paste a whole HTML page with doctype, head and scripts?
Yes. The parser keeps only the <body> content, so the doctype, <head>, meta tags and inline <style> blocks never reach the Markdown at all. Scripts, iframes and embeds are removed on top of that, and event-handler attributes like onclick are always stripped.
Link to answerWill fenced code blocks keep their language?
Yes, when the source uses the standard highlight convention. The converter matches class="language-xxx" on a <code> element inside <pre> and writes that name after the opening fence, so <code class="language-js"> becomes ```js. If no language class is present, you get a plain fence with the code intact.
Link to answerCan it add front matter for Hugo, Jekyll or Astro?
Yes — switch on Add front matter and the output is prefixed with a YAML block containing a title taken from the document's first <h1>, a description field, and today's date formatted as YYYY-MM-DD. The preview tab hides the block so you can still read the rendered document.
Link to answerIs there a file size limit or a signup?
No limit is enforced and no account is required — the only ceiling is your browser's memory, since everything is processed in the page. Uploads accept .html, .htm and .txt, and the downloaded file is named after the file you uploaded, with a .md extension.
Link to answerCan I convert Markdown back into HTML here?
No — this converter is one-directional, HTML in and Markdown out. AltFTool has a separate Markdown to HTML converter for the reverse trip; this page's Preview tab only renders the Markdown for reading, it does not export HTML.
Link to answerEmbed this tool on your site
Add the HTML to Markdown Converter widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/html-to-markdown-converter"
title="HTML to Markdown Converter — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/html-to-markdown-converter?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>