HTML to Markdown converter - free online tool
What is an HTML to Markdown converter?
An HTML to Markdown converter takes HTML markup and rewrites it as Markdown. Use it when you want to move content from a website or CMS into a README, wiki, docs site, or any workflow that prefers Markdown.
Textavia converts in your browser. This is useful when you are pasting internal docs or other content you do not want to send to a remote service.
How to use the HTML to Markdown converter
- Paste HTML: Paste a fragment like
<h2>...</h2><p>...</p>or a whole HTML page. - Pick a flavor: Use GFM if you want Markdown tables for HTML
<table>elements. Use CommonMark if you want stricter Markdown. - Copy Markdown: Copy the Markdown output and paste it into your docs or repo.
Why convert HTML to Markdown?
- Cleaner writing workflow: Markdown is faster to edit than HTML for most docs and READMEs.
- Portable content: Markdown moves between GitHub, GitLab, static site generators, and note apps with fewer surprises.
- Reduce noise: Converting to Markdown strips a lot of inline markup that makes diffs hard to review.
How HTML turns into Markdown
HTML and Markdown do not map perfectly, but most docs content converts cleanly:
- Headings like
<h2>become##headings. - Paragraphs become plain text separated by blank lines.
- Bold and italics become
**bold**and*italic*. - Links become
[text](url). - Code blocks often become fenced blocks with triple backticks.
For tables, pick GFM mode. If you use CommonMark mode, tables may fall back to plain text because tables are not in the core CommonMark spec. GitHub's GFM overview is at https://github.github.com/gfm/.
Use case 1: Copy content from a CMS into a README
If a CMS stores content as HTML, convert it to Markdown so it fits a docs-first repo workflow.
Use case 2: Turn a web page snippet into docs text
Paste a section of HTML from a web page and convert it to Markdown so you can edit it and keep it versioned.
Use case 3: Clean HTML before sharing in chats or tickets
Markdown is easier to paste into issue trackers and internal tools than raw HTML.
Examples
Basic example
Input (HTML):
<h2>Changelog</h2>
<p><strong>Added:</strong> CSV export and a Markdown table tool.</p>
<ul>
<li><a href="https://textavia.com/tools/csv-to-markdown-table">CSV to Markdown</a></li>
<li><a href="https://textavia.com/tools/markdown-table-to-json">Table to JSON</a></li>
</ul>
Output (Markdown):
## Changelog
**Added:** CSV export and a Markdown table tool.
- [CSV to Markdown](https://textavia.com/tools/csv-to-markdown-table)
- [Table to JSON](https://textavia.com/tools/markdown-table-to-json)
Advanced example (HTML tables)
If your HTML has a <table>, choose GFM so the output can use Markdown table syntax.
Input (HTML):
<table>
<thead>
<tr><th>name</th><th>role</th><th>active</th></tr>
</thead>
<tbody>
<tr><td>Ada</td><td>Engineer</td><td>true</td></tr>
<tr><td>Jordan</td><td>PM</td><td>false</td></tr>
</tbody>
</table>
Output (Markdown, GFM):
| name | role | active |
| --- | --- | --- |
| Ada | Engineer | true |
| Jordan | PM | false |
Common errors
The output Markdown looks messy
Some HTML sources include extra wrappers, spans, and inline styles. Fix: format your HTML first and keep the fragment small. The HTML formatter is a good first step.
My HTML contained unsafe tags
If you paste HTML from an unknown source, keep sanitization on. It can remove scripts, iframes, and other tags you probably do not want in your Markdown output.
Links and images look wrong
If your HTML uses relative URLs like /docs/getting-started, the Markdown output will keep them. Fix: replace them with full URLs, or update your docs system to resolve relative links the way you expect.
Tips and proven approaches
- Convert small sections, not entire pages: If you paste an entire page with nav and footers, the Markdown will include lots of junk. Copy the section you want and convert that.
- Use GFM when tables matter: GitHub renders GFM tables well. If you need tables, GFM mode matches common docs workflows.
- Round-trip check: Convert HTML to Markdown, then back with the Markdown to HTML converter to confirm the structure matches your goal. If the result changes too much, keep the content as HTML instead of forcing Markdown.
Related tools
- Convert Markdown into HTML using the Markdown to HTML converter.
- Switch directions in one place with the Markdown ↔ HTML converter.
- Fix spacing and stray line breaks with the Remove line breaks tool. If you need to strip styling entirely, use the Remove formatting tool.
Privacy and security
HTML to Markdown conversion runs locally in your browser. Textavia does not need a server to rewrite your HTML, so your pasted content stays on your device.