HTML ↔ Markdown

Convert between HTML and Markdown.

You copied a section out of a web page and want it as Markdown for your notes — but pasting it brings along a thicket of <div class="..."> wrappers. Or the opposite: you wrote in Markdown and now need real HTML to drop into a CMS field that doesn't speak Markdown.

This tool handles both directions from a single input box. Paste, choose a direction, copy the result.

How it works

The two directions

Markdown → HTML renders your Markdown with GitHub Flavored Markdown enabled, so tables, fenced code blocks, strikethrough, and task lists all work. Single line breaks are preserved as <br> rather than being collapsed into a paragraph — which matches what most people expect when they hit Enter.

HTML → Markdown walks the HTML and rewrites it as Markdown. Headings come out in ATX style (## Heading, not the underlined form), and code blocks come out fenced with backticks rather than indented by four spaces.

What survives the trip, and what doesn't

Markdown is a much smaller language than HTML, so the HTML → Markdown direction is lossy by design:

HTML inputMarkdown output
<h2>, <strong>, <a>, <ul>, <table>converted to the Markdown equivalent
class, id, style attributesdropped
<div>, <span> wrappersunwrapped, contents kept
<iframe>, forms, scriptsnot representable — omitted or left as-is

That lossiness is usually the point: it's how you strip a page down to just the text and structure. But it means the round trip is not guaranteed to be identical. Convert HTML to Markdown, then back, and you'll get semantically equivalent output with the styling hooks gone.

Practical notes

When going HTML → Markdown, paste the smallest fragment you actually want, not the whole page — a full document brings navigation, footers, and cookie banners with it. Whitespace inside <pre> blocks is preserved, so code samples survive intact. Both conversions happen locally in your browser, so nothing is uploaded.

Terms explained

Markdown
A plain-text writing format where `**bold**` and `## Heading` stand in for HTML tags. Readable as-is, and convertible to HTML.
GFM
GitHub Flavored Markdown — the common extended dialect that adds tables, fenced code blocks, task lists, and strikethrough on top of original Markdown.
ATX heading
The `## Like this` heading style, as opposed to the Setext style that underlines the text with `===` or `---`.
Fenced code block
Code wrapped in triple backticks. Preferred over the older four-space-indent style because you can label the language.
Lossy conversion
A conversion where some information can't be represented in the target format and is discarded — here, CSS classes and inline styles when producing Markdown.

Frequently asked questions

Will my CSS classes and styling survive the conversion to Markdown?

No. Markdown has no syntax for classes, IDs, or inline styles, so they are dropped. What you keep is the structure — headings, lists, links, emphasis, tables — and the text itself.

Do tables convert correctly?

Yes, in both directions. Markdown tables are produced from `<table>` markup, and GFM table syntax renders to real `<table>` HTML. Very complex tables using rowspan or colspan have no Markdown equivalent and won't round-trip cleanly.

Why do my single line breaks become new lines instead of merging?

This converter enables the line-break option, so one Enter becomes a `<br>`. Standard Markdown would join those lines into one paragraph, but the line-break behavior matches what most writing tools do.

Can I paste an entire web page?

You can, but you'll get the navigation, sidebar, and footer as Markdown too. Select just the article body in your browser, copy, and paste that fragment instead.

Is anything uploaded to a server?

No. Both conversions run in JavaScript inside your browser, so the content stays on your device.