127

Is there an official file extension for standalone Markdown files?

2
  • 10
    Does anyone use filename.md.txt in the same way as filename.rst.txt? It indicates that it's markdown format, but also falls back to plain text if you don't have something to handle markdown. GitHub recognizes .rst.txt, but not .md.txt: gist.github.com/2770487
    – endolith
    Commented May 22, 2012 at 17:44
  • 3
    If you plan on storing these files on a Windows machine then I'd stick with an <= 3 character extension. This makes .md and .mkd the only commonly used options. Of those .md is FAR more popular so I highly suggest using that. Don't worry about machine descriptor files; they aren't that widely used and they should be perfectly editable in a Markdown Editor (just ignore the preview portion of the editor).
    – krowe2
    Commented Oct 27, 2014 at 20:24

7 Answers 7

122

There is no requirement for a Markdown file extension. However to ensure editors or parsers recognise a file is Markdown-formatted, one of the following extensions would be checked for:

.md
.mkd
.mdwn
.mdown
.mdtxt
.mdtext
.markdown
.text

There are websites such as GitHub that use subset of these extensions when converting to HTML so developers will conform to their standard.


Examples of extension usage:

GitHub: .markdown, .mdown, .mkdn, .mkd, .mdwn, .md (source)

Vim markdown: .markdown, .mdown, .mkdn, .mdwn, .mkd, .md (vim-m-src)

Bitbucket: .md, .mkd, .mkdn, .mdown, .markdown, .text (source)


Further Reading

The Markdown mailing list has interesting discussions about this topic: 1, 2, such as this snippet:

Markdown isn't meant to take over the format of a file, it's a way to subtly add information to the plaintext. Really, the presence of Markdown is metadata, not a file format.

No one opening a text file will be confused if they find Markdown syntax, it's pure bonus. In this sense, it makes sense to use ".text", ".txt", or whatever other plaintext extension is relevant.

An editor which knows nothing about Markdown won't care about the metadata and won't be confused by the variety of "non-standard" extensions, but will display and edit the plaintext just fine.

4
  • Bitbucket uses md, mkdn, markdown: confluence.atlassian.com/display/BITBUCKET/… Commented Jan 4, 2012 at 0:39
  • 1
    .md and .markdown appear to be the most common extensions in use at this point. Commented Aug 2, 2017 at 20:08
  • 1
    Little update on the extensions recognized by GitHub, it seems the list grew a bit: md, mkd, mkdn, mdwn, mdown, markdownsource Commented Jan 27, 2019 at 10:04
  • my school editor supports mdn. Commented Jul 5, 2022 at 11:05
17

The idea of MarkDown and similar light-weight markups is to be readable as plain text, thus they have text/plain extension (.txt or .text).

However, there are some people who use .markdown or .mdown.

8
  • 2
    Just for the record, Elements for the iPhone recognizes .md, .markdown, .mdown, .mdwn and .text
    – Beat Rupp
    Commented Feb 26, 2011 at 10:31
  • 4
    vim 7.3 recognizes .markdown and .mdown, so .markdown is the most descriptive one. Commented May 19, 2011 at 11:19
  • 1
    Kohana uses .md Commented Jul 24, 2011 at 11:33
  • 3
    I've seen a couple of .md in GitHub too, and my Vim at the office recognizes it as Markdown (I've to check why it doesn't at home).
    – Wernight
    Commented Jul 27, 2011 at 6:17
  • 1
    This answer is not as extensive / complete as the one with the most votes.
    – svandragt
    Commented Aug 25, 2011 at 12:01
4

iA Writer uses the extension .md for Markdown content.

4

Doxygen added Markdown support in v1.8. It looks for .md or .markdown file extensions.

3

I'm not aware of one, but I think a precedent is set by the use of the .text extension on the official website to reveal the Markdown that produces the pages.

2
1

In short, the answer is no.

If you are simply using markdown files as stand-alone files that will not be processed in any way, name them however you please. If you are using them in a system the processes them into HTML or PDF or some other format, then you need to figure out what file extensions that system expects for markdown files.

Also, in the context of a UNIX system, file extensions are not even mandatory. You could simply have a file called "README" in markdown format.

1
  • But file will only tell you that it is ASCII text, which does not tell me that I can run it through markdown. Commented Jun 8, 2011 at 19:21
0

Hmm... Geany, the open source IDE, when saving a Markdown formatted file, uses the .mdml extension. Strange that it seems to be the only one...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .