# .md MIME Type: text/markdown

> Markdown text, registered by RFC 7763.

- MIME type: `text/markdown`
- Extensions: .md, .markdown
- Content-Type header: `text/markdown; charset=utf-8`
- Compress in transit: yes

## 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.

## Server configuration

### 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">
```

## FAQ

### 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

- [.txt — text/plain](https://www.devkult.com/mime/txt.md)
- [.html — text/html](https://www.devkult.com/mime/html.md)

Open the interactive page: https://www.devkult.com/mime/md