← All guides

Understanding Cron Expressions (5 Fields Explained)

A cron expression is five fields that define a schedule: minute, hour, day of month, month and day of week. Learn the syntax with clear, worked examples.

A cron expression is five fields separated by spaces that define when a task runs: minute, hour, day-of-month, month and day-of-week. For example, 0 9 * * 1 means "at 09:00 every Monday".

The five fields

In order, with their ranges:

  • Minute — 0 to 59
  • Hour — 0 to 23
  • Day of month — 1 to 31
  • Month — 1 to 12
  • Day of week — 0 to 6 (0 = Sunday)

The special characters

  • * — every value ("any")
  • */5 — every 5 units (a step)
  • 1,15 — a list of specific values
  • 9-17 — a range of values

Worked examples

  • */15 * * * * — every 15 minutes
  • 0 9 * * 1 — 09:00 every Monday
  • 0 0 1 * * — midnight on the 1st of every month
  • 0 8-18 * * 1-5 — every hour from 08:00 to 18:00 on weekdays
  • 0 0 * * 0 — midnight every Sunday

Build one visually

Instead of memorising the syntax, use the cron expression generator to build and read a schedule field by field. Working with times and epochs too? See the timestamp converter. Related: What is JSON and how to format it.