Blog / RFC 5545 Explained: Inside the iCalendar Specification
· 5 min read

RFC 5545 Explained: Inside the iCalendar Specification

A developer-friendly breakdown of RFC 5545, the standard that defines the iCalendar format used by every .ics file.

RFC 5545, published by the IETF in 2009, defines the iCalendar format — the plain-text standard behind every .ics file, every meeting invite, and every "Add to Calendar" button on the web. Here's what developers need to know.

Structure

An iCalendar object uses CRLF line endings. It starts with BEGIN:VCALENDAR and ends with END:VCALENDAR. Two properties are required: VERSION:2.0 and PRODID (identifies the creating software). Inside, you nest components:

  • VEVENT — a calendar event
  • VTODO — a task with optional due date
  • VFREEBUSY — free/busy blocks for scheduling
  • VTIMEZONE — embedded timezone definition
  • VALARM — reminder, nested inside VEVENT or VTODO

The RRULE Recurrence System

Recurrence rules are the most complex part of the spec. An RRULE is a semicolon-separated list of parts:

RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR;UNTIL=20251231T235959Z

FREQ is required (DAILY, WEEKLY, MONTHLY, YEARLY). Key modifiers: BYDAY, BYMONTHDAY, BYMONTH, COUNT, UNTIL, INTERVAL. Expanding recurrences correctly — especially with EXDATE exceptions and DST transitions — is non-trivial. Use a library like ical.js rather than rolling your own.

Timezones

Use UTC (Z suffix) or a TZID parameter — never rely on "floating" date-times, which are interpreted in the reader's local timezone and will silently show the wrong time:

DTSTART;TZID=America/New_York:20250415T090000

X-Properties

Any property starting with X- is a vendor extension that must be silently ignored by compliant parsers. Common examples: X-WR-CALNAME (Google display name), X-WR-TIMEZONE (Google default timezone), X-APPLE-STRUCTURED-LOCATION.

Common Pitfalls in Real-World Files

  • Missing UID on VEVENT (required by spec)
  • LF-only line endings instead of CRLF
  • Line folding at character boundaries instead of octet boundaries — corrupts multi-byte UTF-8
  • Unescaped commas and semicolons in TEXT values
  • Timezone IDs that don't match IANA names

A robust parser needs to handle all of these gracefully. The ical.js library used by ICS Viewer is battle-tested against a wide range of real-world files.

Want to preview an ICS file right now?

Open ICS Viewer →