HTML TO
MARKDOWN
Convert HTML markup to clean Markdown syntax. Perfect for transforming web content into documentation format.
SUPPORTED ELEMENTS
TEXT FORMATTING
- <strong> → **bold**
- <em> → *italic*
- <code> → `code`
STRUCTURE
- <h1-h6> → # Headers
- <ul> → - Lists
- <blockquote> → > Quote
WHY CONVERT HTML TO MARKDOWN?
Most markdown editors and static site generators expect .md files, not HTML. If you copied content from a website, CMS export, or WYSIWYG editor, it arrives as HTML. Converting it to markdown gives you clean, portable text you can version in Git, edit in any text editor, and publish with any static site generator.
COMMON REASONS TO CONVERT
- Migrating from WordPress or other CMS platforms to a static site
- Cleaning up pasted content from Google Docs or Word
- Converting API responses or scraped web pages into readable text
- Working with LLMs that prefer plain markdown over HTML
- Stripping tracking attributes, inline styles, and span soup from copied HTML
The conversion preserves semantic structure: h1-h6 become # headings, strong becomes **bold**, em becomes *italic*, a tags become [link](url), and code blocks are fenced with triple backticks.
WHEN TO USE THIS TOOL
MIGRATING A WORDPRESS BLOG TO GATSBY OR HUGO
You exported your WordPress posts as HTML and now need them as .md files. Paste each post body into this tool, copy the output, and save it as a file in your content directory. The headings, links, bold text, and lists all carry over cleanly without any manual editing.
CLEANING UP CONTENT PASTED FROM A WYSIWYG EDITOR
Google Docs, Notion exports, and email clients all produce HTML when you copy-paste. That HTML is often full of inline styles, empty spans, and div wrappers that serve no purpose in markdown. Run it through here to get the actual content, stripped of the noise.
FEEDING WEB CONTENT INTO AN LLM OR RAG PIPELINE
If you are scraping web pages to use as context for a language model, markdown is easier to token-count, chunk, and parse than raw HTML. Convert the page HTML first and your embeddings will be cleaner with less noise from tags and attributes.
HOW THE CONVERSION WORKS
The converter parses your HTML into a document tree, then walks each node and maps it to its markdown equivalent. Block-level elements like headings, paragraphs, and lists become their own lines. Inline elements like bold, italic, links, and code get wrapped in the appropriate markdown syntax.
WHAT GETS CONVERTED
- Headings (h1 through h6) become # through ######
- Unordered lists become hyphen-prefixed lines, ordered lists become numbered lines
- Anchor tags become [text](url) with the href preserved
- Images become  with the alt attribute carried over
- Pre and code blocks become fenced code blocks with triple backticks
- Blockquotes become lines prefixed with >
Inline styles, class attributes, data attributes, and presentational tags like span are dropped. The output is plain, portable markdown with no hidden formatting.
FREQUENTLY ASKED QUESTIONS
DOES IT HANDLE NESTED HTML LIKE TABLES OR DEFINITION LISTS?
Basic HTML tables are converted to GFM-style markdown tables with pipe characters. Definition lists and more obscure HTML elements may be converted to plain text or dropped entirely, since standard markdown has no equivalent syntax for them. Check the output and adjust manually if needed.
WILL IT PRESERVE LINKS AND IMAGE URLS?
Yes. Anchor tags are converted to [link text](href), and image tags become . The href and src values are kept exactly as they appear in the HTML, whether they are absolute URLs, relative paths, or data URIs.
WHAT HAPPENS TO INLINE STYLES AND CSS CLASSES?
They are stripped out. Markdown does not support inline CSS, so class names, style attributes, and presentational HTML are removed. If something was bold only because of a CSS class rather than a strong or b tag, that formatting will not survive the conversion.
CAN I CONVERT A FULL WEBPAGE OR JUST FRAGMENTS?
Both work. You can paste a full HTML document including the doctype, head, and body, or just a snippet like a single article tag or a div with content. The converter extracts meaningful content from whatever you give it and ignores structural boilerplate like head tags and script blocks.
RELATED TOOLS
MARKDOWN TO HTML
Convert markdown files to HTML output. The reverse of this tool.
MARKDOWN FORMATTER
Clean up and normalize existing markdown files. Fix inconsistent heading levels, list styles, and spacing.
MARKDOWN EDITOR
Edit and preview your converted markdown. Live preview with syntax highlighting.
PDF TO MARKDOWN
Convert a PDF document to Markdown with automatic heading detection.
WORD TO MARKDOWN
Convert a Word .docx document to Markdown instead.
JSON TO MARKDOWN
Convert JSON data to a Markdown table or list.