Markdown Editor & HTML Converter · Tutorial

How to move a blog post from HTML to Markdown

6 min readbeginnerUpdated

You are moving an old blog to a static site generator that uses Markdown files. This tutorial converts one saved post, including its head, styles and scripts, into clean Markdown, then shows what to check and tidy before you publish it on the new site.

What you need

  • The Markdown Editor and its Import HTML button
  • The post's HTML (save the page or view its source), or the sample from the Try it button

Steps

  1. Get the post's HTML

    Open the post in your browser and save the page as HTML, or copy the HTML of the article from your CMS. The sample is a full page about lunchbox ideas with a <head>, a style block and a script.

  2. Import it into the editor

    Press Import HTML, paste the HTML and press Convert to Markdown, or simply open the saved .html file with the file picker. The editor now holds Markdown, and the preview shows the post. The page title, styles and the analytics script have disappeared, because they are not part of the visible content.

  3. Check the structure

    The <h1> is now a # heading, section titles are ## headings and the steps are a numbered list. The link to the onigiri guide keeps its address, and the image becomes ![A packed bento box](/images/bento.jpg) with its alt text.

  4. Check the table

    The prep-times table is now a Markdown pipe table, which most static site generators render as an HTML table again.

    | Idea | Minutes |
    | --- | --- |
    | Onigiri | 15 |
    | Noodle salad | 20 |
  5. Fix links and images for the new site

    Links like /recipes/onigiri point to paths on the old site. Update them to the new addresses, and copy images such as /images/bento.jpg into your new site's image folder.

  6. Save as a Markdown file

    Add the front matter your site generator expects, such as a title and date, at the top, then press Download .md and rename the file after the post, for example five-lunchbox-ideas.md. Most site generators use the file name as the page address.

Try it yourself

Opens the Markdown Editor & HTML Converter with this tutorial's sample loaded.

Try it now

Common mistakes

Copying the whole page with menus
If you save the entire page, navigation, sidebars and footers come along as text and links. Copy only the article element where possible, or delete the extra parts afterwards.
Removing the backslash in "1\."
## 1\. Onigiri is correct Markdown. Without the backslash some renderers would start a numbered list. The backslash is not shown on the page.
Expecting colours and fonts to survive
Markdown has no styling. Apply the look through your new site's theme instead.

Next steps

Go back to the Markdown Editor & HTML Converter, or keep going with one of these:

FAQ

Can I convert many posts at once?

This tool converts one document at a time. Paste each post in turn, or script a bulk migration for hundreds of posts.

What about embedded videos?

Iframes are removed. Add the embed again using your site generator's shortcode or HTML.