Convert HTML to clean Markdown, or Markdown to HTML with a safe preview: headings, lists, links, images, code blocks and GFM tables, entirely in your browser.
Documentation, blog posts and knowledge-base articles often start life as HTML, but notes apps, static site generators, READMEs and wikis want Markdown. This tool converts in both directions in your browser. HTML to Markdown walks the parsed HTML and writes headings, bold and italic text, links, images, nested and numbered lists, task-list checkboxes, blockquotes, fenced code blocks (keeping a language-xxx class as the fence language) and GFM tables, with the table alignment kept. Markdown to HTML renders GitHub-flavored Markdown with a source view and a sandboxed preview. Nothing you paste is uploaded.
Headings h1 to h6, paragraphs, strong/b, em/i, del/s, inline code, pre blocks (with the language taken from a language-xxx class), links, images, ul and ol lists with any nesting (ordered lists keep their start number), task-list checkboxes, blockquotes, hr, br, tables and definition lists. Wrapper elements such as div, section, article and span are unwrapped and only their content is kept.
Markdown cannot express everything HTML can, so styling is dropped: colors, fonts, inline CSS, classes and ids, table cell merges (colspan and rowspan) and nested tables inside cells. Script, style, iframe, svg, canvas, button and form-control elements are removed. If a table has no header row, its first row is used as the header because GFM tables require one.
Characters that Markdown would otherwise interpret, such as asterisks, backticks, square brackets, a leading # or - at the start of a line, and underscores at word edges, are backslash-escaped so the text renders as written. Underscores inside words like snake_case are left alone. A pipe inside a table cell is escaped as \|.
No. The HTML is parsed into an inert document with the browser DOMParser, which does not execute scripts or load images, and the converter only reads its text and attributes. In Markdown to HTML mode the preview is shown in an iframe with the sandbox attribute and no permissions, so even unsanitized output cannot run code.
It removes script, iframe, object, embed, link, style, meta, base and form elements, every on-event attribute such as onclick, and javascript: links in href and src. It is a basic safety net for output you plan to paste into a page, not a replacement for a dedicated sanitizer with an allow-list when you publish untrusted content.
GitHub-flavored Markdown through the marked library, so tables, task lists, strikethrough and fenced code blocks work. Single line breaks are not turned into br tags, as in standard Markdown, and raw HTML inside your Markdown is passed through (and sanitized when that option is on).
The Markdown Previewer shows how Markdown looks, and Markdown to PDF turns it into a document. This tool is about converting the source text itself: HTML into Markdown you can edit and commit, or Markdown into HTML source you can copy into a template.
No. Parsing and conversion run in your browser tab. Only the Markdown renderer script is downloaded from a CDN the first time you use Markdown to HTML; your text is never sent to it.
← All tools · Text & Data · Blog · Cheat sheets · FAQ