# .ics MIME Type: text/calendar

> Calendar events and feeds in iCalendar format (RFC 5545).

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

## Good to know

- Serve calendar subscription feeds with this type so calendar apps recognise them; `webcal://` links point at the same file.
- iCalendar lines end with CRLF and long lines are folded at 75 octets.

## Server configuration

### nginx (inside the types block in mime.types)

```
text/calendar ics;
```

### Apache (.htaccess or server config)

```
AddType text/calendar .ics
```

### Express

```
res.set("Content-Type", "text/calendar; charset=utf-8");
```

### Python

```
import mimetypes

mimetypes.add_type("text/calendar", ".ics")
```

### HTML file input

```
<input type="file" accept=".ics,text/calendar">
```

## FAQ

### What is the MIME type for .ics files?

`text/calendar`.

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

`Content-Type: text/calendar; 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)
- [.vtt — text/vtt](https://www.devkult.com/mime/vtt.md)

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