HTML to Markdown Converter

Convert HTML into clean Markdown while preserving headings, lists, links, code blocks and tables.

How to Convert HTML to Markdown

  1. Paste an HTML fragment or upload a supported .html file.
  2. Convert the source and review which semantic elements remain meaningful in Markdown.
  3. Convert and inspect links, images, nested lists, tables and code fences.
  4. Copy the Markdown or download the .md file.

What Does the Converter Preserve?

What Does the Converter Preserve?
Source contentPossible conversion resultConversion note
HeadingsMap <h1><h6> to Markdown headings
Paragraphs and emphasisConvert paragraphs, strong and emphasis
ListsConvert ordered, unordered and nested lists
LinksPreserve text and resolved URL
ImagesPreserve source and alt text
CodeUse inline code and fenced blocks
TablesConvert compatible tables to GFM
BlockquotesConvert semantic blockquotes

What May Change During Conversion?

Scripts, styles and forms

Executable and interactive elements do not have an ordinary Markdown equivalent and may be omitted or reduced to text.

Complex tables

Row spans, column spans, nested tables and rich cell content may need raw HTML or flattening.

Relative URLs

A pasted fragment may not include the page’s base URL, so relative links and image paths cannot always be resolved.

Layout containers

div, grid and flexbox layout do not imply a semantic reading order.

Hidden and boilerplate content

The converter needs a clear policy for hidden elements, navigation and visually collapsed content.

Common Uses for HTML to Markdown

Migrate web documentation

Move semantic HTML into a Markdown-based documentation system.

Clean copied rich text

Convert editor-generated HTML into a simpler format before versioning or publishing.

Prepare code examples

Retain code blocks and headings without carrying the full page stylesheet.

Create text-first AI context

Remove scripts and styling while retaining the information structure that must still be reviewed.

HTML to Markdown Example

Input
<h2>Setup</h2>
<p>Read the <a href="/guide">guide</a>.</p>
<ul><li>Install</li><li>Test</li></ul>
Expected Markdown
## Setup

Read the [guide](/guide).

- Install
- Test

Tips for Cleaner Markdown Output

  1. Use semantic HTML Headings, lists and tables convert more reliably than generic layout containers.
  2. Provide a base URL when needed Relative links require context if the result should work outside the original page.
  3. Choose an output dialect GFM supports tables and task lists that baseline CommonMark does not define.
  4. Review code fences Confirm the detected programming language and any embedded backticks.
  5. Decide the raw-HTML fallback Keeping unsupported HTML may preserve information but reduce portability.

Review Large Files Before Conversion

For large or complex files, start with a representative sample and review the generated output before relying on it.

Check the output for missing text, reading order, and layout issues before using it in another system.

Frequently Asked Questions

Are <script> and <style> elements removed?

Scripts and styles are not useful Markdown content and should not be relied on in the result. Review pasted HTML before reusing the output.

Are HTML tables converted to Markdown tables?

Compatible rectangular tables can become GFM tables. Tables with rowspan, colspan, nested blocks or multiple header rows need a documented fallback.

Are code blocks and inline code preserved?

They can be mapped from <pre> and <code>.

What happens to links and images?

Valid link text and destinations may be retained. Relative links and image paths remain context-dependent because an uploaded fragment has no guaranteed base URL.

Are unsupported HTML tags removed or retained?

Presentation-only wrappers may be simplified while readable text is retained. Compare the output with the source when custom elements carry meaning.

Does the converter output CommonMark or GFM?

The intended output is GitHub-Flavored Markdown. Tables, strikethrough and task lists rely on GFM extensions.

Can I paste an entire HTML document?

Yes. You can paste a fragment or upload an .html or .htm file, then review the generated Markdown.

Can this page convert a live website URL?

No. This page accepts pasted HTML or an uploaded HTML file; it does not fetch a live website URL.

Convert Markdown Back to PDF

Already have a Markdown file? Use theMarkdown to PDF converterto create a shareable PDF.