DEV Community

Cover image for Convert: Medium Markdown
An Rodriguez
An Rodriguez

Posted on

Convert: Medium Markdown

Recently, I've been writing in and Medium.

I have found it's a hassle to keep both sites in sync. Sometimes I tweak here or there.

One of the things I like a lot about is that you write in straight markdown. When you edit an article you edit directly the Markdown.

As a huge plus, you can install tools like Grammarly that help you identify typos or other grammar mistakes. Grammarly also comes with a handy browser add-on you can install and it will check your article as you type in

This is not true for Medium. Not true about writing in plain Markdown and not true for Grammarly either.

That is why I like to write primarily in and later import articles into Medium.

Medium to Markdown

Though it can feel markdown-ish, Medium does not give an option way to obtain the markdown of your article back.

If you're not afraid of the CLI there is, however, a very interesting npm tool I've just learned about: mediumexporter.

It's very easy to use (Thanks @macropus for such an useful post!):

  1. If you yet don't have npm, install it.
  2. After installing npm, run npm install -g mediumexporter
  3. Finally, download your article with mediumexporter >

After executing that last command, you'll find your Medium article in the current directory under the name

Markdown to Medium

Sometimes you have a nice markdown document you want to import to Medium. Fortunately, you can import your story to Medium going to Stories->Import Story.

However, there is also another very nice tool called that takes care of your beautiful code snippets and automatically posts them to Github.

How does it work?

This tool takes the pain out of importing a Markdown post into Medium by doing the manual labor for you (creating a gist on Github of your markdown). It also scans your Markdown file for any code blocks and extracts them into their own gists so Medium can syntax highlight them.

Automatically updating a Medium story with a revised markdown

I haven't figured out how to automatically update a Medium article from a revised markdown.

AFAIK, Medium does not have a way to reimport a story. If it were possible, then the "Markdown to Medium" method would work.

So, for now, I just export the Medium story to markdown and compare it with the revised markdown article. I then modify the Medium article change by change, one by one. It's a hassle, but it is what it is.

Do you have a better method? If so, I'd like to know about it.

Top comments (3)

eekayonline profile image
Edwin Klesman

I found out about the mediumexporter cli recently myself. Works nicely.

Updating changes into Medium content keeps being a hassle. Only fix I have is better checking my article before publishing 😅.

Keep up the writing!

feldev profile image
Félix Paradis

I found another solution which is better if you want to process ALL your Medium posts.

pftg profile image
Paul Keen

We use and looks good enough