devkult_
tools29converters34

.md MIME type

Markdowntext & code

text/markdown

Markdown text, registered by RFC 7763.

MIME typetext/markdown
Extensions.md, .markdown
Content-Typetext/markdown; charset=utf-8
Compress in transit?Yes — enable gzip or Brotli

Good to know

  • RFC 7763 defines an optional variant parameter (for example variant=GFM), but almost no software reads it.
  • Devkult serves a Markdown edition of every page — add .md to any URL.

Serve .md files with the right type

The response header to send:

Content-Type: text/markdown; charset=utf-8

Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:

nginx (inside the types block in mime.types)
text/markdown md markdown;
Apache (.htaccess or server config)
AddType text/markdown .md .markdown
Express
res.set("Content-Type", "text/markdown; charset=utf-8");
Python
import mimetypes

mimetypes.add_type("text/markdown", ".md")
mimetypes.add_type("text/markdown", ".markdown")
HTML file input
<input type="file" accept=".md,.markdown,text/markdown">

Check it

See what a server sends for a file, and what type a local file really is by its contents:

curl -sI https://example.com/file.md | grep -i '^content-type:'
file --mime-type file.md

Frequently asked questions

What is the MIME type for .md files?

text/markdown. The same type covers .markdown.

What Content-Type header should a .md file be served with?

Content-Type: text/markdown; charset=utf-8. As a text format, include the charset so browsers don't guess the encoding. It compresses well, so let the server apply gzip or Brotli.

Related types

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options