ToolHub

Markdown ↔ HTML Converter

Convert between Markdown and HTML with live preview

Markdown input

HTML output

Conversion runs locally in your browser using marked and turndown. Your text never leaves your device.

Overview

Convert Markdown and HTML in both directions

Markdown is the writing format that powers GitHub READMEs, most modern blog platforms, Notion documents, Obsidian notes, and the inline content on Reddit, Discord, and Slack. HTML is the format browsers actually render. Converting between the two is a common need: writers who think in Markdown but need HTML to paste into a CMS, developers who want to clean up raw HTML into readable Markdown source, and anyone moving content between platforms that speak different formats.

ToolHub Markdown Converter handles both directions with live preview, copy, and full GitHub Flavored Markdown support. Conversion runs in your browser using the well-known marked and turndown libraries. Your content never leaves your device.

Step-by-step

How to use the converter

  1. 1

    Pick a direction

    Toggle between Markdown to HTML and HTML to Markdown at the top. The labels on each pane update so you always know which side is input.
  2. 2

    Type or paste your content

    Drop Markdown source or HTML markup into the left pane. The output regenerates on every keystroke, so you can tweak and watch the result update live.
  3. 3

    Toggle preview (Markdown to HTML only)

    For Markdown to HTML, click Preview to see the rendered result instead of the raw HTML. Useful for checking that your formatting actually looks right before you ship it.
  4. 4

    Copy and use

    Hit copy to grab the full output. Paste it into your blog, Slack, Notion, GitHub, email, or wherever the next step in your workflow needs it.

Use the swap button

The arrow icon between the panes swaps your input and output. Useful when you want to round-trip content: convert Markdown to HTML, edit a bit, then convert back to Markdown to see the cleaned-up source.

Background

What is Markdown?

Markdown is a lightweight markup language created by John Gruber and Aaron Swartz in 2004. The design goal was simple: make a syntax that is both readable as plain text and convertible to clean HTML. The result is a tiny set of conventions that look like email formatting:

  • # Heading for an h1, ## Subheading for an h2, and so on
  • **bold** for strong, _italic_ for emphasis
  • [text](url) for links, ![alt](url) for images
  • - item for bulleted lists, 1. item for numbered
  • `code` for inline, three backticks for code blocks
  • > quote for blockquotes

The original spec was small. GitHub Flavored Markdown (GFM) extended it with tables, task lists, strikethrough, and fenced code blocks with syntax highlighting hints. GFM is now the de facto standard everywhere people write Markdown.

Why people prefer Markdown to HTML

  • Faster to write: a few characters do the work of long HTML tags.
  • Readable as source: even unrendered, Markdown is comfortable to read.
  • Portable: every modern tool understands at least basic Markdown.
  • Future-proof: plain text outlives any specific app or platform.
  • Diff-friendly: version control shows clean changes line by line.

Comparison

Markdown vs HTML: when to use which

MarkdownHTML
Best forWriting source contentFinal rendered page
Learning curveMinutesHours to days
Feature ceilingLimited (text content)Unlimited (any UI)
Custom stylingNot supportedFull CSS control
Where it runsSource files, docs, READMEs, blogsWeb pages, emails, apps
ToolingLightweight (text editor)Browser dev tools, design tools

The right pattern is usually: write in Markdown, convert to HTML at publish time. Tools like Next.js, Hugo, Gatsby, and most static site generators do exactly this automatically.

Use cases

When to convert each direction

Publishing to a CMS

Some platforms only accept HTML in their editors. Write in Markdown, convert, paste.

Pasting into Slack or Discord

These render Markdown but not HTML. If your source is HTML, convert to Markdown first.

Cleaning up rich text editor output

Word, Google Docs, and similar produce ugly HTML. Convert to Markdown and back to get clean output.

Migrating between platforms

Moving from Medium to Ghost, WordPress to Hugo, Notion to a static site? Markdown is the universal middle ground.

Writing technical documentation

Source files in Markdown, render to HTML for the public docs site. Used by Stripe, GitHub, Linear, almost everyone.

Composing emails with code

Some email tools accept HTML but you write in Markdown. Convert before pasting into the email composer.

Reference

GitHub Flavored Markdown features supported

Tables

Pipe-separated columns with a header divider row. Cell alignment with colons in the divider: | --- | for default, | :--- | for left, | ---: | for right, | :---: | for center.

Task lists

List items prefixed with [ ] for unchecked or [x] for checked. Useful for project status, checklists, and TODOs.

Fenced code blocks

Three backticks open and close a code block. Add a language identifier after the opening backticks (like ```js) for syntax highlighting in tools that support it.

Strikethrough

Text wrapped in double tildes: ~~strikethrough~~. Renders as a struck-through span.

Auto-linking

Plain URLs in text get auto-converted to clickable links. No square brackets needed.

Common Markdown mistakes

  • Forgetting blank lines: most Markdown processors require an empty line before lists, code blocks, or headings to recognize them.
  • Using single asterisk for italic in some places: stick to either underscore or asterisk consistently to avoid confusion.
  • Mixing tabs and spaces in code blocks: use spaces only or your code block may break.
  • Putting blank line inside a list item: that ends the list. Keep continuation indented without blank lines.
  • Using HTML inside Markdown without sanitization: most processors allow inline HTML, which is a security risk if the source is user-supplied.
  • Expecting tables to work in classic Markdown: tables are GFM-only. Standard Markdown does not support them.

Common questions

Why does my HTML to Markdown output look stripped?

Markdown supports a small subset of what HTML can express. CSS classes, inline styles, custom attributes, complex nested divs, and visual layout (multi-column grids, absolute positioning) have no Markdown equivalent and are discarded during conversion. The output preserves the semantic content but not the visual design.

Can I keep raw HTML inside my Markdown?

Yes. The Markdown spec allows inline HTML, and our converter preserves it. This is useful for things Markdown cannot express (centered images, video embeds, inline styles). Be careful with user-generated Markdown though: inline HTML is also a vector for XSS attacks.

Does this support MDX?

Not directly. MDX is Markdown plus JSX (React components). MDX requires a build step that compiles components, which is beyond a simple text converter. For MDX content, write and process it in your build pipeline.

Can I customize the output HTML?

Not from this tool. The HTML output uses standard tags (h1, p, ul, code, pre, table, etc.) without classes or inline styles. Add styling with your own CSS after pasting the output into your project.

Is the rendering safe from XSS?

The Preview pane renders the HTML output directly. If you paste untrusted Markdown that contains script tags, those would execute in the preview. Only paste content you wrote or trust. For server-rendering Markdown from end users, always sanitize with a library like DOMPurify or rehype-sanitize.

100% private

Privacy and security

Content stays on your device

Conversion uses marked and turndown, both running entirely in your browser. There is no upload, no logging, no analytics on your text. Open developer tools and watch the Network tab during conversion: zero outbound requests carry your content.
  • No file or network upload
  • Works offline once the page is loaded
  • Compatible with private and incognito browsing
  • Open-source libraries (marked and turndown), inspectable in your browser

Related tools

Quick steps

1

Pick a direction

Markdown to HTML for publishing, HTML to Markdown for clean source files.

2

Type or paste

Conversion happens live as you type. Use Sample to load example content.

3

Preview or copy

Toggle the rendered preview, or copy the output ready to paste anywhere.

Frequently asked questions

Which Markdown flavor is supported?

GitHub Flavored Markdown (GFM): standard headings, lists, links, images, plus tables, task lists, strikethrough, and fenced code blocks. The same dialect used by GitHub, GitLab, Reddit, and most modern blogging platforms.

Will my content be uploaded?

No. Conversion runs entirely in your browser using marked (Markdown to HTML) and turndown (HTML to Markdown). Open the developer tools Network tab and confirm: zero outbound requests carry your content.

Can I convert Markdown with custom HTML inside?

Yes. marked allows raw HTML inside Markdown by default. The output preserves your inline tags. Be aware this is also why you should sanitize untrusted Markdown before rendering.

Why does HTML to Markdown sometimes lose formatting?

Markdown is a strict subset of HTML's possibilities. CSS classes, inline styles, custom attributes, and complex nested layouts have no Markdown equivalent and are dropped during conversion.