MarkdownKit
HTML source to clean Markdown

HTML to Markdown Converter

Paste HTML source or open a local .html file. Remove markup noise, review conversion warnings, and export clean Markdown.

Source

HTML input

Source code

Ready

Local only · No upload · 5 MB file limit

How to Convert HTML to Markdown

Paste HTML source into the input above or open one local .html or .htm file. HTML to Markdown conversion runs in your browser, removes unsafe or presentation-only markup, and generates editable Markdown beside the source. This is a source-level workflow: you can inspect cleanup notices before copying or downloading the result.

  1. 01Add source

    Paste a complete document, an article fragment, or a CMS field. For a local export, choose Upload .html; files must be 5 MB or smaller.

  2. 02Choose a profile

    Use Standard for portable Markdown, GitHub for GFM tables, or AI-ready when layout-only page elements should also be removed.

  3. 03Inspect the result

    Complete the HTML to Markdown workflow by checking the preview and diagnostics, fixing anything source-specific, then copying the text or downloading a .md file.

Because browser parsing can repair incomplete fragments, compare the final headings, links, lists, tables, images, and code with the source before a large migration.

Which HTML Elements Become Markdown?

Semantic HTML has a close Markdown counterpart. Presentation wrappers usually do not. During HTML to Markdown conversion, the tool reads the DOM created from your source and maps useful content rather than echoing every tag. Its diagnostics count headings, links, images, lists, tables, and code blocks so you can see what was recognized.

Headings, Links, Lists, and Blockquotes

h1 through h6 become hash-style headings. Paragraphs remain paragraphs, strong and emphasized text become Markdown emphasis, and blockquote content becomes quoted lines. Ordered list numbering and unordered list structure are kept where the source DOM exposes them. Safe links retain their destination; links using unsafe schemes such as JavaScript, data, blob, or local file URLs lose that destination.

HTML Tables and GitHub Flavored Markdown

Choose GitHub or AI-ready to produce GitHub Flavored Markdown tables. If a source table contains no header cells, the first row is promoted to a header and a notice records the decision. Standard mode emits readable pipe-separated rows instead of promising table syntax that core Markdown does not define.

Simple rows and columns transfer well; layout tables and complex spans do not. Markdown cannot faithfully express rowspan or colspan, so every merged cell is counted in a review warning. Check those tables manually and consider rewriting them as smaller tables or lists. If a CMS export is easier to inspect as rows first, you can turn extracted CSV rows into a fresh Markdown table.

Code Blocks and Images

A pre containing code becomes a fenced code block. Language hints from a valid lang attribute or a language-* class are retained on the fence, and longer fences are used when code itself contains backticks. Inline code remains inline.

An image with an absolute HTTPS URL can remain a Markdown reference. The converter does not check whether the address is reachable or publicly accessible. Data, blob, local-file, and other sources become alt text and are reported; remote assets are not downloaded or re-hosted.

Clean HTML from CMS Exports and Email Templates

CMS exports often mix article structure with classes, IDs, inline styles, analytics hooks, and nested layout wrappers. An HTML to Markdown workflow keeps the readable hierarchy while discarding markup that only served the original theme. This is useful when moving a blog archive into static documentation, collecting legacy help-center articles in a repository, or reviewing content outside a proprietary editor.

Email templates need extra judgment. Their HTML may use tables for layout, buttons for calls to action, and inline CSS for compatibility across mail clients. HTML to Markdown can preserve the written copy, links, simple tables, and images, but it cannot reproduce the email's visual layout. Treat the output as a clean editorial draft, not as a reversible template conversion.

For repeated migrations, test representative source types first: a short post, a long article, a code-heavy guide, and the most complex table. The notices help reveal patterns in the export, while a manual sample check tells you whether those patterns need a source-side fix before processing more files.

HTML to Markdown for AI and RAG

HTML to Markdown for retrieval pipelines starts by removing noise from documentation exports. Navigation labels, forms, footers, buttons, and theme markup add tokens without adding the article's central meaning. AI-ready mode keeps GitHub Flavored Markdown support and removes nav, aside, footer, form, and button elements before conversion.

The result is easier to segment, review, and version as source material for a knowledge base or retrieval-augmented generation workflow. It is not an automatic guarantee of model-ready data: repeated headers inside generic divs, legal boilerplate, stale copy, access rules, and document boundaries still require editorial decisions. Use the diagnostics and preview as a cleanup checkpoint, then apply the metadata and chunking strategy required by your own system.

Static documentation is another strong fit. Convert a rendered article export to Markdown, commit the result beside code, and review future edits as text diffs. Fenced code, headings, links, and simple tables remain visible without the original site's CSS or JavaScript runtime.

What Gets Removed During Conversion?

During HTML to Markdown conversion, script, style, noscript, and template elements are removed before Markdown generation. Inline style and class attributes are discarded, as are IDs and data attributes. Event-handler attributes such as onclick are stripped. Unsafe link destinations are removed, and unsupported image sources fall back to alt text. AI-ready mode additionally removes common layout and interaction elements.

The workbench reports these changes as notices or review items instead of hiding them. A clean-conversion message means no tracked issue was found; it does not certify the meaning of arbitrary source. Because processing stays in the browser tab, the HTML is not uploaded to a conversion backend. That local boundary is especially useful for unpublished documentation and exported internal knowledge, though you remain responsible for handling the source according to your organization's policies.

HTML to Markdown Limitations

These HTML to Markdown limitations define what needs review before you reuse or publish the result.

  • No webpage fetching. The input accepts HTML source or one local file; it does not crawl a URL, run a remote page's JavaScript, or collect linked pages. URL crawling is a separate workflow with networking, permissions, robots, and content-selection concerns.
  • No layout reconstruction. CSS grids, flex layouts, columns, email presentation, interactive widgets, forms, and canvas content do not have direct Markdown equivalents.
  • Complex tables need review. Merged cells are reported because Markdown tables cannot preserve row or column spans. Tables designed only for layout may be better rewritten.
  • Remote assets stay remote. Absolute HTTPS image URLs may remain references, but the tool neither checks reachability nor downloads, validates, optimizes, or re-hosts them.
  • Manual edits are protected. Once you edit generated Markdown, changing the source or profile will not overwrite it silently. Use Regenerate when replacement is intentional.

HTML to Markdown FAQ

How do I convert HTML to Markdown?

Paste HTML source into the input or open one local .html or .htm file, choose Standard, GitHub, or AI-ready output, and inspect the generated Markdown and cleanup notices before copying or downloading it.

Can I upload an HTML file?

Yes. You can open one UTF-8 .html or .htm file that is 5 MB or smaller. The file is read and converted locally in your browser and is not uploaded to a conversion service.

Does HTML to Markdown preserve tables and code blocks?

GitHub and AI-ready profiles produce GitHub Flavored Markdown tables, while Standard produces readable pipe-separated rows. Fenced code blocks and recognized language hints are preserved. Tables with merged cells need manual review because Markdown cannot represent rowspan or colspan faithfully.

What HTML does the converter remove?

It removes script, style, noscript, and template elements; visual class and style attributes; IDs, data attributes, event handlers, unsafe link destinations, and unsupported image sources. AI-ready also removes nav, aside, footer, form, and button elements.

Can I convert a webpage URL here?

No. This converter does not fetch or crawl webpage URLs. Paste the HTML source or open a local HTML file; URL crawling is a separate workflow with networking, permissions, robots, and content-selection requirements.

Should I use the Rich Text or HTML converter?

Use the HTML converter when you have source markup or an .html file and need cleanup diagnostics. Use the Rich Text to Markdown converter when you are copying visible formatted content from Google Docs, Notion, Microsoft Word, or email without working with source code.