HTML ↔ Markdown
Convert HTML to Markdown or Markdown back to HTML, entirely in the browser.
Your files never leave your device. Everything runs in your browser.
What HTML ↔ Markdown does
HTML to Markdown converts both ways in a single card. Paste HTML and click the first button to get Markdown; paste Markdown and click the second to get an HTML fragment. Everything runs in the page with the browser parser, so drafts and internal documents never leave your machine.
The HTML to Markdown direction walks the parsed document and keeps headings, paragraphs, lists, links, images, blockquotes, bold, italic, inline code, fenced code blocks and horizontal rules. Scripts, styles and page metadata are dropped, as are classes, identifiers and inline styles, because Markdown has no place to put them. A paragraph with a link, a bold word and an italic word converts back to Markdown exactly as you would type it.
The Markdown to HTML direction is a small converter with no dependencies: headings from one to six hashes, paragraphs, unordered and ordered lists, blockquotes, horizontal rules, links, images, inline code, fenced code blocks, bold and italic. It produces a fragment you can paste into your own page structure, not a complete document.
How to use HTML ↔ Markdown
- Paste the source into Input.
- Click HTML → Markdown or Markdown → HTML.
- Read the result in the read-only Output box.
- Use Copy result to copy it, or Clear to empty both boxes.
- To test a round trip, copy the output, paste it back into Input and convert in the other direction.
Features
- Both directions in one place, with separate buttons and a shared output box.
- Headings h1 to h6, paragraphs, bold, italic, inline code and fenced code blocks.
- Unordered and ordered lists, blockquotes and horizontal rules.
- Links keep their target URL and images keep source and alt text.
- Scripts, styles, titles and page metadata are dropped from HTML input.
- No network requests and no third-party parser: conversion is instant and local.
Tips and common mistakes
- HTML to Markdown keeps text, structure and link targets but drops presentation: classes, identifiers and inline styles disappear, so a styled callout becomes a plain paragraph.
- Nested lists are flattened to one level. A sub-item inside a list item is emitted as a sibling dash item, so a two-level list becomes a single flat list in the output.
- Tables are not converted. Cell text is concatenated without separators, so a two-row table with cells Name, Age, Ana, 30 came out as the single string NameAgeAna30 in a verified sample. Rebuild tables by hand after converting.
- Markdown to HTML supports only the subset listed above. Table syntax is not parsed and renders as plain paragraphs full of pipe characters, and reference-style links, task lists and footnotes are left untouched.
- Headings in the HTML direction only come from heading tags; bold text at the start of a paragraph is not promoted to a heading.
- Whitespace is normalised: runs of spaces collapse and three or more blank lines shrink to one, so the output may be tidier than the input.
- The output is a fragment, not a page — wrap it in your own html and body tags if you need a full document.
Frequently asked questions
Is the conversion done on a server?
No. The browser parses the HTML and both converters run as page code, so nothing is transmitted. There is also no third-party library downloaded at runtime.
Which Markdown features are supported?
HTML to Markdown handles headings, paragraphs, bold, italic, links, images, lists, blockquotes, inline code, fenced code blocks and horizontal rules. Markdown to HTML handles the same set. Tables, task lists, footnotes, reference links and setext headings are not supported.
Why did my HTML lose its styling?
Markdown only carries content and structure, so classes, identifiers, inline style attributes and layout tags are discarded on purpose. The words and the links survive; the look does not.
Can I convert a whole web page?
You can paste the body markup of one, but structure that has no Markdown equivalent is flattened, and scripts, styles and head content are removed. The converter is happiest with article-style fragments rather than full navigation-and-widget pages.
Is the Markdown to HTML output sanitised?
No. It is a lightweight converter, not a sanitiser: plain text is escaped, but link and image attributes are copied from the source, and fenced code content is passed through unchanged. Do not render output from untrusted Markdown into a live page without a dedicated sanitiser.
Does the output include a full HTML page?
No, both directions produce fragments. Wrap the Markdown to HTML result in your own page template when you need a complete file.
Related text tools: Markdown Editor, Readability Score, Find & Replace, Word Counter.
Both conversions run entirely in your browser — nothing is uploaded, and no parser is downloaded from a third party.