Converting HTML to Markdown and back sounds simple — until tables collapse, images break, and your code blocks lose their syntax highlighting. Here's the cheat sheet.
Converting HTML to Markdown is something most developers and writers do every week — turning a WordPress export into a Hugo blog, pulling a ChatGPT reply into a README, or moving a Confluence page to a Git-tracked docs folder. The conversion itself is fast; the gotchas are what make it feel painful. Here are the seven pitfalls that catch even experienced writers, with a fix for each.
HTML tables can have rowspan, colspan, merged headers, footer rows, and column groups. Markdown tables — even GitHub-flavoured (GFM) tables — support none of that. They're a flat grid of rows and columns with a header separator and that's it.
When you convert a complex HTML table to Markdown, anything beyond the basic grid is silently dropped. Cells with merged spans become empty or duplicated. Fix: before converting, simplify your source table to a flat grid in the HTML editor, or convert and then keep the table as raw HTML inside the Markdown document (GFM allows inline HTML).
HTML images use absolute or relative URLs and may include CDN parameters (?w=800&auto=format). When you convert to Markdown and move the file to a new docs folder, relative paths point to nothing, and absolute paths may bring along query strings that break the target CMS.
Fix: after converting, search the output for ![ and audit each image link. Strip query strings if the new host doesn't need them, and convert relative paths to absolute URLs (or copy the images into a known assets folder and update the paths in bulk).
A well-formed HTML code block looks like <pre><code class="language-js">...</code></pre>. A converter that handles this correctly will produce a fenced Markdown block with the language hint: ```js. A converter that doesn't will produce a plain fenced block with no language — killing the syntax highlighting in your blog's renderer.
Fix: use a converter that preserves class="language-*". Our HTML to Markdown converter does this by default. After conversion, grep for ``` lines with no language and add the hint by hand.
Markdown has no concept of inline CSS. <span style="color: red;">, <div style="text-align: center;">, custom font sizes — all gone after conversion. The text survives; the styling doesn't.
Most of the time this is fine (Markdown is supposed to be portable plain text, after all). But if your HTML uses color for semantic meaning (red = error, green = success), you'll lose that signal. Fix: replace styled spans with semantic Markdown alternatives — bold for emphasis, blockquotes for callouts, and emoji for status (✅ ❌ ⚠️).
HTML entities like “, —, …, may convert to the literal Unicode characters (good) or stay as entities (bad, because they render as literal — in Markdown viewers).
Fix: use a converter that decodes entities by default. If your output has entities, run a quick search-and-replace: — → —, “ → “, and so on.
If you convert HTML → Markdown → HTML, you will not get the original HTML back. Markdown is a simpler grammar, so any HTML feature it can't represent (inline styles, classes, custom attributes, complex tables) is lost on the first hop and can't be reconstructed.
Fix: treat HTML → Markdown as one-way for production migrations. If you need round-tripping (e.g. a CMS that stores Markdown but renders HTML for editing), accept that the round trip is "lossy lossless" — the text survives, the presentation simplifies.
HTML doesn't care about line length; everything is one continuous flow until the browser wraps it. Markdown does care — some renderers treat single line breaks as <br>, others ignore them. After conversion, you may find oddly-wrapped paragraphs or missing line breaks.
Fix: pick a wrap policy and stick to it. Either soft-wrap every paragraph to a single long line (best for diffs and most renderers), or hard-wrap at 80 columns (best for reading raw Markdown in a terminal). Most editors have a "reflow paragraph" command (in VS Code: Alt+Q).
If you're migrating content regularly, here's the workflow that has the fewest surprises:
Convert the HTML to Markdown with a GFM-aware tool — like our HTML to Markdown converter.
Open the output in our Markdown previewer to verify rendering before committing it to your repo or CMS.
Fix any tables, images, or code blocks that look wrong.
Decide on a line-wrap policy and reflow the paragraphs.
Run the Markdown through your target site's renderer (GitHub, Hugo, Docusaurus) as a final sanity check.
Markdown is the right format for most blog posts, docs, and READMEs. It's the wrong format when the source has heavy formatting that you actually want to preserve — complex tables, custom layouts, embedded media, scientific notation. In those cases, keep the HTML, or migrate to a richer format like MDX (which lets you mix Markdown with JSX components).
GFM is GitHub's superset of CommonMark that adds tables, task lists (- [ ]), strikethrough (~~text~~), autolinks, fenced code blocks with language hints, and a few other quality-of-life features. It's the de facto standard outside of academic and publishing-specific contexts.
Yes — use the Markdown previewer and copy the rendered HTML. Just remember email HTML has its own quirks (inline styles, no class selectors, table-based layouts) so you may still need a final polish in an email-specific tool.
Most converters insert a blank line after every block-level element for safety (so the next paragraph isn't accidentally treated as a continuation). It's harmless — renderers collapse consecutive blank lines. If you want a clean output, run a regex replace: \n{3,} → \n\n.
<head>?A good converter strips <head>, <script>, and <style> automatically. You can paste an entire HTML document and only the visible body content gets converted.
Creating helpful tools and sharing productivity insights to make your work easier.
Text to speech for listening to drafts and short passages. Choose an available voice, adjust rate and pitch, and use Speak or Stop to control playback.
URL parser for inspecting a link by component. Enter a full URL, parse it, and review the protocol, host, path, query, and fragment details.
User agent parser for browser, operating system, and device details. Paste a User-Agent string or use the current browser value, then inspect the parsed fields.
Compare today or another selected date in common formats and check a custom pattern before copying.
Start a direct WhatsApp chat without saving a contact. Add a number with its country code and an optional message, then open WhatsApp.
Convert between gold karats, purity percentage, touch, tunch, and 916/750/585/375 hallmark markings. Free online gold karat calculator and purity converter.
QR code generator for URLs and text. Adjust dimensions, margin, colors, and an optional logo, then download the code and test it before sharing.
Open a Telegram chat link with a username or international phone number, then review and send your message in Telegram.