Markdown and HTML converter

The Markdown and HTML converter turns Markdown into HTML code and, in the other direction, converts HTML code into clean Markdown, including GitHub-flavored tables, task lists, and strikethrough.
Input
Paste Markdown or HTML and choose the direction. Up to 1 MB.

Conversion runs in your browser. Please enable JavaScript.

Everything runs in your browser; nothing is sent or stored.

  • Paste your text or code in the "Markdown or HTML" field, and click "Markdown to HTML" or "HTML to Markdown".
  • When the page loads, the input field contains a Markdown sample, and its conversion to HTML appears in the "Resulting code" field.
  • GitHub syntax is supported: tables, task lists (- [x]), and strikethrough (~~). When converting HTML to Markdown, headings are written with #, code blocks with ```, and bullets with -. Merged table cells are not preserved. HTML written inside the Markdown is copied to the result as is.
  • Below the result, the tool shows the number of characters, and when converting to Markdown, also the number of tables converted and the number of elements removed.
  • The result is shown only as code, never rendered as a page. When converting HTML to Markdown, the code is read without running scripts or loading images, and elements such as script, style, iframe, and object are removed.
  • Copy the result by clicking "Copy".

Converting Markdown to HTML code

Markdown is a simple syntax for writing formatted text: a # sign at the start of a line creates a heading, asterisks mark emphasis, and a hyphen at the start of a line creates a bullet point. Converting to HTML is useful for moving a README file, documentation, or an article draft into a content management system or a page template. The conversion supports GitHub Flavored Markdown (GFM), so web addresses written as plain text, without link syntax, also become links. Headings in the result have no id attribute, so to link to a heading from within the page, add the id manually.

Converting HTML to Markdown

Converting from HTML is useful for moving content from an existing website to a Markdown-based system, such as a static site generator, a wiki, or a code repository. Headings, paragraphs, links, images, lists, blockquotes, and code blocks become Markdown syntax, and tables become Markdown tables. Formatting that has no Markdown equivalent, such as color, font, or underline, is removed, and the text itself is kept. Characters that have a meaning in Markdown, such as an asterisk within the text, get a backslash before them so that they are displayed as they are. Images keep their URL and alternative text (alt), and links keep their URL and link text.

HTML inside Markdown

Markdown syntax lets you write HTML within the text, and the conversion to HTML copies it to the result as written, including script tags and attributes such as onclick. Before you publish Markdown that comes from users or from an external source, filter the generated HTML with a dedicated HTML sanitization library.

Markdown and HTML snippets and their conversion results

  • ~~old~~becomes <del>old</del>.
  • - [x] donea task list item becomes a list item with a checked checkbox.
  • https://example.coma URL in the text becomes a link: <a href="https://example.com">https://example.com</a>.
  • <ol start="3"><li>a</li></ol>becomes 3. a, and the numbering starts at the number set in the start attribute.
  • <img src="logo.png" alt="Logo">becomes ![Logo](logo.png).
  • <p>1. Text</p>becomes 1\. Text: the period after the number gets a backslash so that the line does not become a numbered list.
  • <u>text</u>the tag is removed, and the text is kept.
Did you know?

A site built from Markdown documents with a static site generator can be hosted on static website hosting plans.

Static website hosting plans

Markdown and HTML converter FAQ

Why doesn't a single line break in Markdown create a new line in HTML?

In Markdown, adjacent lines are treated as one paragraph, so a single line break does not appear on the page. To start a new paragraph, add a blank line, and to break a line within a paragraph, add two spaces at the end of the line.

How is the language of a code block preserved?

A code block in Markdown starts with three backticks, and you can write the language name after them, for example bash. When converting to HTML, the language name is kept in the language-bash class of the code tag, and syntax highlighting libraries use this class to color the code. When converting to Markdown, a class such as language-bash becomes the language name at the start of the block.

Can I convert an entire web page to Markdown?

Yes. You can paste the source code of an entire page, and the parts that are not content, such as the head section and the script and style tags, are removed. The page menu, header, and footer appear in the result, so for a cleaner result, paste only the code of the main content.

What happens to a table with merged cells?

Markdown tables have no merged cells, so a merged cell becomes a single cell, and the number of cells may vary from row to row. The table caption, defined in the caption tag, is not included in the result, and you can add it manually as a paragraph above the table.

Does the conversion preserve right-to-left text direction?

Right-to-left text is kept in both conversion directions. Markdown has no way to specify text direction, so the dir attribute of tags is not kept when converting to Markdown, and the text direction is set by the page where the content is displayed.

What is the maximum size of a Markdown or HTML document I can convert?

The input can be up to 1 MB, and the result can be up to 4 MB. Nested blockquotes in Markdown are processed up to 100 levels deep.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement