Convert HTML to clean Markdown instantly. Free HTML to Markdown converter with configurable heading styles, link formats, and code block options.
An HTML to Markdown converter takes HTML markup (tags like <h1>, <p>, <a>, <strong>) and translates them into equivalent Markdown syntax. The heading becomes # Heading, the paragraph stays as plain text, the link turns into [text](url), and the bold tag becomes **text**.
The result is clean, readable text that preserves the document's structure without the visual noise of HTML tags. Markdown is used everywhere: GitHub READMEs, documentation sites, static site generators, CMS platforms, and increasingly as the input format for AI and LLM pipelines.
This tool runs the conversion entirely in your browser. Paste your HTML, adjust the output settings if needed, and get Markdown you can copy directly into your project. No data is sent to any server.
The conversion takes three steps:
The converter handles full HTML documents and fragments equally well. You can paste an entire page (it will ignore <head> and metadata) or just a section of markup. If you change the conversion options, click Convert again to regenerate with the new settings.
This converter exposes four settings that control how the Markdown output is generated:
| Option | Choices | What it controls |
|---|---|---|
| Headings | ATX, Setext | ATX uses # prefixes (# H1, ## H2). Setext underlines H1 with === and H2 with ---. ATX is far more common in modern Markdown. |
| Bullets | -, *, + |
The character used for unordered list items. All three produce the same output when rendered. Dash is the most common convention. |
| Code blocks | Fenced, Indented | Fenced uses triple backticks (```). Indented uses four-space prefixes. Fenced blocks support language annotations for syntax highlighting. |
| Links | Inline, Reference | Inline puts the URL right after the text: [text](url). Reference collects URLs at the bottom: [text][1] with [1]: url at the end. Reference style keeps long URLs out of the reading flow. |
Every common HTML element has a Markdown equivalent. Here is how this converter maps them:
| HTML | Markdown |
|---|---|
| <h1> to <h6> | # to ###### |
| <p> | Plain text with blank lines |
| <strong>, <b> | **bold** |
| <em>, <i> | *italic* |
| <a href="..."> | [text](url) |
| <img src="..." alt="..."> |  |
| <ul> / <ol> | - item / 1. item |
| <blockquote> | > quoted text |
| <code> | `inline code` |
| <pre><code> | ``` code block ``` |
| <hr> | --- |
| <br> | Two trailing spaces or backslash |
Elements without a Markdown equivalent (like <div>, <span>, and <style>) are stripped, and their text content is preserved where possible. Inline styles and class attributes are removed since Markdown has no concept of CSS.
HTML-to-Markdown conversion comes up in several common developer workflows:
Not every HTML element has a clean Markdown equivalent. Here is how this converter handles the tricky ones:
Tables. Standard Markdown supports tables with pipe syntax, but the conversion depends on the table structure. Simple tables with <thead> and <tbody> convert cleanly. Complex tables with colspan, rowspan, or nested tables may lose their layout. For complex tables, consider using a dedicated data formatting tool instead.
Nested lists. HTML allows deeply nested <ul> and <ol> elements. The converter preserves nesting by indenting child items, following CommonMark conventions.
Images. The <img> tag converts to . If no alt attribute is present, the alt text is left empty. The title attribute, if present, is included after the URL.
Inline styles and classes. Markdown has no styling layer. All style, class, and id attributes are stripped. If your HTML relies on classes for visual meaning (like colored text or custom badges), that information is lost in the conversion.
Script and style blocks. The content of <script> and <style> elements is removed entirely. These are rendering artifacts, not content, and have no place in a Markdown document.
HTML and Markdown serve different purposes. HTML is a rendering language. It tells a browser exactly how to display content, including layout, styles, and interactivity. Markdown is a writing format. It captures the structure of content (headings, lists, emphasis, links) without prescribing how it looks.
Use HTML when you need precise control over presentation: landing pages, emails with custom layouts, interactive web applications. Use Markdown when you need portable, readable content: documentation, README files, blog posts, technical writing, and data destined for LLM processing.
The conversion from HTML to Markdown is lossy by design. Markdown intentionally lacks support for colors, custom fonts, absolute positioning, and JavaScript. That constraint is the point. It forces content to be clean, focused, and compatible with any rendering context.
No. This HTML to Markdown converter runs entirely in your browser using JavaScript. The HTML you paste is processed locally on your device. Nothing is uploaded or stored.
The output follows CommonMark conventions by default. When using ATX headings and fenced code blocks, the result is compatible with GitHub Flavored Markdown (GFM), GitLab Markdown, and most static site generators.
Yes. Paste the entire HTML source and the converter will extract the text content, ignoring <head>, <script>, and <style> elements. For best results, paste only the <body> content or the specific section you need.
Simple tables with a header row and body rows convert to Markdown pipe tables. Complex tables with merged cells, nested tables, or missing headers may produce imperfect results since Markdown tables have limited structure.
Yes. <img> tags are converted to Markdown image syntax: . The image file itself is not downloaded. Only the reference is preserved.
ATX headings use hash marks (# H1, ## H2). Setext headings use underlines: === for H1 and --- for H2. Setext only supports two heading levels, while ATX supports six. ATX is the dominant convention in modern Markdown.
Yes. If you copy content from a WYSIWYG editor, Google Docs, or Notion and paste it as HTML, this tool will convert it to clean Markdown. The rich formatting (bold, italic, headings, lists, links) is preserved; visual-only styles (fonts, colors, spacing) are stripped.
If you work with HTML and structured content, these tools handle adjacent tasks:
Structured page data instead of raw HTML. Your agent processes less, decides faster, and costs less to run.