Developer Guide
What Is a Cron Expression? A Complete Guide to Cron Syntax
Learn what a cron expression is, how its five fields work, and how to read or write one for scheduling automated tasks.
What Is a Cron Expression?
A cron expression is a short, structured string that defines a recurring schedule for automated tasks — most commonly used with the Unix/Linux cron daemon, but also adopted by countless scheduling tools, CI/CD pipelines, and job queues across nearly every platform. Instead of writing "run this every weekday at 9am" in plain English, a scheduler needs something precise and machine-readable — that's what a cron expression provides.
The Five Fields of a Standard Cron Expression
A standard cron expression has five space-separated fields, always in this order:
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, Sunday=0)
│ │ │ │ │
* * * * *
An asterisk (*) in any field means "every value" for that field. So * * * * * means "every minute, of every hour, of every day" — i.e., run once a minute, constantly.
Reading Real Examples
0 3 * * * — at minute 0 of hour 3, every day → runs at 3:00 AM daily.
*/15 * * * * — every 15th minute, every hour, every day → runs at :00, :15, :30, :45 of every hour.
0 9 * * 1-5 — at 9:00 AM, but only Monday through Friday (day-of-week field 1-5) → a weekday-only 9am schedule.
0 0 1 * * — at midnight, on day 1 of every month → runs once a month, on the 1st.
Special Characters You'll Encounter
Asterisk (*) — matches every possible value for that field.
Comma (,) — specifies a list, e.g. 1,15 in the day field means "the 1st and 15th of the month."
Hyphen (-) — specifies a range, e.g. 1-5 in the day-of-week field means Monday through Friday.
Slash (/) — specifies a step value, e.g. */15 in the minute field means "every 15 minutes."
Common Shorthand Expressions
Many cron implementations also support shorthand strings in place of the five fields: @yearly (or @annually) runs once a year, @monthly once a month, @weekly once a week, @daily (or @midnight) once a day, and @hourly once an hour. These are convenient but not universally supported across every scheduler, so check your specific tool's documentation.
Where Cron Expressions Show Up
Beyond the traditional Unix cron daemon, this same expression format (or a close variant) is used by: CI/CD pipeline schedules (GitHub Actions, GitLab CI), cloud scheduler services (AWS EventBridge, Google Cloud Scheduler), application-level job schedulers in nearly every programming language, and container orchestration tools like Kubernetes CronJobs.
Writing Your Own
Manually working out the right combination of fields for a specific schedule — especially anything beyond the simplest daily/hourly patterns — is easy to get subtly wrong. Use our free Cron Expression Generator to build a schedule using plain English, a visual builder, or by pasting an existing expression to see exactly what it means and when it'll next run.
Conclusion
A cron expression's five fields — minute, hour, day-of-month, month, day-of-week — combine with a small set of special characters (*, ,, -, /) to express nearly any recurring schedule precisely. Once you can read the fields in order, decoding (or writing) any cron expression becomes straightforward.