HTML to Markdown

Runs 100% in your browser

Convert clean HTML back to Markdown — headings, bold, italic, code, tables, lists, links, images, and blockquotes with full GFM support.

HTML INPUT

Source document

0 bytes
0 lines 0 elements
MARKDOWN OUTPUT

Converted Markdown

Waiting
0 bytes 0 lines
RENDERED PREVIEW

Markdown preview

Local preview — review before publishing
Converted Markdown preview will appear here.
Load or paste HTML to see conversion statistics.
Input bytes0
Markdown bytes0
Elements0
Links0
Images0
Tables0
Conversion, not a visual clone. Markdown cannot represent every CSS layout, rowspan/colspan table, embedded widget, or custom element. Enable "Preserve unsupported HTML" to keep unknown elements and review the local preview before publishing.

Recent conversions

No history yet — convert an HTML document to see results here.
100% private.

HTML parsing and Markdown serialization happen locally in your browser using the built-in DOMParser API and FileReader. No HTML source is uploaded, transmitted, stored in localStorage or sessionStorage, or sent to any analytics service. Clipboard access is only requested when you click Paste or Copy.

Frequently asked questions

An HTML to Markdown converter parses HTML markup and translates each element to its Markdown equivalent. Headings become # prefixes, bold text becomes **asterisks**, code blocks become backtick fences, and tables are converted to GFM pipe-table syntax. The result is a lightweight plain-text document that can be edited in any text editor and rendered back to HTML by any Markdown processor.

Common use cases include migrating web pages or CMS content to a Markdown-based static site generator like Hugo, Jekyll, or Astro; extracting readable text from HTML emails; authoring README files from existing documentation; and reducing content size before storing it in a Git repository or headless CMS.

Yes. HTML tables are converted to GFM pipe-table syntax, which is supported by GitHub, GitLab, Bitbucket, VS Code preview, Obsidian, and most modern Markdown processors. Column count is preserved and cell content is escaped where needed.

You can paste full-page HTML and the converter will process all recognised elements. Navigation menus, scripts, and style blocks that have no Markdown equivalent are stripped from the output. The resulting Markdown contains only the prose content.

Both ordered and unordered lists are converted recursively. Each nesting level is indented by two spaces. Ordered lists use the original numeric sequence from the HTML. Mixed nesting (ordered inside unordered and vice versa) is preserved correctly.

Images are converted to the Markdown image syntax ![alt text](src). The alt attribute is preserved. If no alt text is present, an empty pair of brackets is used. The src URL is kept as-is so images continue to resolve correctly.

Yes. Inline code uses single backticks and fenced code blocks use triple backticks. The language hint from the class attribute (e.g. class="language-javascript") is extracted and placed after the opening fence for syntax highlighting in compatible renderers.

Reference Links mode collects all hyperlinks and images at the bottom of the document as a numbered reference list. This improves readability for documents with many repeated URLs and is the preferred style in some style guides and documentation frameworks.

Each line of a blockquote element is prefixed with a > character. Nested blockquotes produce nested > > prefixes. Blockquotes that contain paragraphs, lists, or code blocks maintain the prefix on every line.

Yes. Switch to Preview mode and the converter renders the generated Markdown back to HTML in a sandboxed panel. This lets you verify that headings, lists, tables, and emphasis look correct before copying the Markdown.

All conversion happens entirely in your browser using vanilla JavaScript. No HTML content is sent to any server. You can disconnect from the internet and the tool continues to work, which makes it safe for internal documentation, proprietary code, and private content.

The strong element becomes **text**, em becomes *text*, and del becomes ~~text~~. Combinations such as strong inside em produce ***text***. The kbd element becomes `key` inline code, abbr elements include their title in square brackets, and sup/sub are kept as literal text with a note.

Yes. Use the Open File button to load any local .html or .htm file. The file is read by the browser's FileReader API and the conversion begins immediately. Files are never uploaded to a server.

You can download the Markdown output as a .md file with a single click. The filename is derived from the page title element when present. You can also copy the output to the clipboard with a one-click Copy button.

Common named entities such as &, <, >, ",  , —, –, and © are decoded to their Unicode characters before conversion. Numeric character references are also decoded. This produces clean, readable Markdown without HTML entity sequences.

The hr element is converted to three hyphens --- on its own line, which is the standard Markdown thematic break syntax. A blank line is added before and after to ensure correct parsing.

When Strip formatting is enabled, inline emphasis markers (bold, italic, strikethrough) are removed from the output, producing plain prose text. This is useful when you want to extract readable content without stylistic markup.

Yes. The dual-panel layout shows the HTML input on the left and the Markdown output on the right simultaneously. You can also switch to a diff view or preview mode to inspect the conversion result in detail.

Yes. HTML dl, dt, and dd elements are converted to a readable Markdown-compatible format. The definition term is bolded and the definition description follows on the next line with a colon prefix, which is compatible with extended Markdown processors that support definition lists.

What is HTML to Markdown?

HTML to Markdown conversion translates HTML markup into lightweight Markdown syntax that can be edited in any text editor, stored in Git, and rendered by any standard Markdown processor. The process maps every semantic HTML element to its closest Markdown equivalent: headings become hash prefixes, bold text becomes double asterisks, italic text becomes single asterisks, and tables become pipe-delimited GFM rows.

ToolsSonic's HTML to Markdown converter runs entirely in your browser. No HTML is transmitted to any server. You can use it safely for internal documentation, proprietary CMS exports, HTML email content, and confidential web pages. The conversion engine uses the browser's native DOMParser so that even malformed HTML is handled gracefully.

How HTML Elements Map to Markdown

Each HTML element has a deterministic Markdown equivalent. Headings h1 through h6 produce one to six leading hash characters followed by a space. The paragraph element produces a plain text block separated by blank lines. The strong and b elements become double asterisks, em and i become single asterisks, and del and s become double tildes for GFM strikethrough. Inline code uses single backticks and pre-formatted code blocks use triple-backtick fences with the language class extracted from the element's class attribute for syntax-highlighted rendering in GitHub, VS Code, Obsidian, and other compatible tools.

Links use the standard [text](url) syntax. When Reference Links mode is selected, all URLs are collected at the bottom of the document as a numbered reference list, which is the preferred style in documentation frameworks that emphasise readability of the raw source. Images use ![alt](src) notation with the alt attribute preserved. Blockquotes are prefixed with > on each line with nested blockquotes using repeated > characters. Horizontal rules produce --- on their own line. Hard line breaks produce two trailing spaces before the newline.

GFM Table Conversion

HTML tables are converted to GitHub Flavored Markdown pipe-table syntax. The first row of the table is treated as the header row and a separator line of hyphens and pipes is inserted between the header and body rows. Cell content that contains pipe characters is escaped automatically. The column count matches the original HTML and empty cells produce empty pipe-delimited fields. GFM tables are rendered by GitHub, GitLab, Bitbucket, Obsidian, VS Code Markdown preview, Notion, and most headless CMS platforms that accept Markdown input.

Nested tables — tables within table cells — are flattened to the outer column structure, which is a known limitation of Markdown's single-level table model. Complex table layouts should be reviewed after conversion.

Workflow and Output Modes

The converter supports four output modes. Markdown mode shows the raw converted output. Split mode shows the HTML input and Markdown output side by side. Diff mode highlights which lines were preserved and which were transformed. Preview mode renders the Markdown output back to HTML in a sandboxed panel, letting you verify heading levels, list depth, code block language hints, and table alignment before copying.

For bulk workflows, open a local .html or .htm file using the file picker — no upload required. Use the Download button to save the output as a .md file with a filename derived from the page's title element. The 8-item history panel lets you recall and re-compare previous conversions within the same session without losing work.

Common use cases

  • Migrating a CMS or WordPress site to a Markdown-based static site generator (Hugo, Jekyll, Astro)
  • Converting HTML email newsletters to readable Markdown for documentation archives
  • Extracting clean prose from HTML web pages for note-taking in Obsidian or Notion
  • Authoring GitHub README files from existing HTML documentation pages
  • Converting scraped HTML content to Markdown for storing in a Git-based content repository
  • Stripping HTML tags from templated content to produce plain-text Markdown drafts

Why use ToolsSonic's HTML to Markdown?

ToolsSonic converts HTML to Markdown entirely in your browser with no server upload. It handles GFM tables, nested lists, fenced code blocks with language hints, blockquotes, reference links, definition lists, and HTML entities — more complete than most online converters that skip tables or drop inline code fences.

Element Conversion Reference

HTML ElementMarkdown OutputNotes
h1–h6# to ######Level determined by tag number
pPlain paragraphSeparated by blank lines
strong, b**text**Double asterisks
em, i*text*Single asterisks
del, s~~text~~GFM strikethrough
code (inline)`code`Single backtick
pre > code```lang\n…\n```Language from class attribute
a[text](url)Reference mode: [text][1]
img![alt](src)Alt attribute preserved
ul / ol- item / 1. itemNested with 2-space indent
blockquote> textNested with repeated >
tableGFM pipe tableHeader + separator + body rows
hr---Thematic break on own line
brTwo trailing spacesHard line break
kbd`key`Inline code style
abbrtext [title]Title appended in brackets
dl / dt / dd**term**\n: definitionExtended Markdown format
script / style(removed)No Markdown equivalent

Markdown Dialect Compatibility

FeatureCommonMarkGFM (GitHub)PandocMultiMarkdown
Headings h1–h6
Bold / italic
Strikethrough ~~
Fenced code blocks
GFM pipe tables
Reference links
Definition lists
Hard line breaks
100% private — runs in your browser Instant — no server round-trip Free forever — no account needed

Markdown to HTML

Editor's choice

Convert Markdown to clean, structured HTML locally — headings, paragraphs, links, images, lists, tables with column alignment, nested lists, task lists, blockquotes, setext headings, and fenced code with a sanitized preview.

Markdown Formatter

Editor's choice

Format Markdown locally with consistent headings, lists, blank lines, blockquotes, tables, code fences, GFM task lists, strikethrough, diagnostics, history, preview, copy, and download.

Markdown Preview

Editor's choice

Render Markdown as HTML and preview it live — sanitized, script-free, with a clear source/preview split.

Markdown Table Generator

Editor's choice

Create aligned GitHub Flavored Markdown pipe-table syntax visually — edit rows and columns, paste from Excel, Google Sheets, CSV, or an existing Markdown table, set per-column alignment, escape pipes, preview the rendered result, and download .md, .html, or .csv. Free, no upload.

HTML Editor

Editor's choice

Edit HTML with a live preview — synchronized source editor, WYSIWYG visual pane, sandboxed preview, 5 starter templates, format, minify, validate, find/replace, file import, and download. 100% in your browser.

HTML Entity Decode

Editor's choice

Decode named, decimal, and hexadecimal HTML entities back to readable text. Inspect entity counts, preview source safely, and copy or download decoded output locally.