Skip to content
Dev Utilities 7 min read

Cron Expressions Explained: A Complete Syntax Reference

Master cron job syntax with field-by-field breakdown, special characters, named shortcuts, timezone handling, common examples, and how to avoid scheduling mistakes.

ToolsVito Team

Cron Field Structure

A cron expression has 5 fields (Unix crontab) or 6 fields (many tools like AWS EventBridge and GitHub Actions add a seconds field):

┌─────────── minute (0–59)
│ ┌───────── hour (0–23)
│ │ ┌─────── day of month (1–31)
│ │ │ ┌───── month (1–12 or JAN–DEC)
│ │ │ │ ┌─── day of week (0–7, 0 and 7 are Sunday, or SUN–SAT)
│ │ │ │ │
* * * * *

Special Characters

  • * — any value (wildcard)
  • , — list separator: 1,3,5 means 1, 3, and 5
  • - — range: 1-5 means 1, 2, 3, 4, 5
  • / — step: */15 means every 15 units; 0-30/5 means every 5 from 0 to 30
  • L — last (day of month or week): L in day-of-month = last day of month
  • W — nearest weekday: 15W = nearest weekday to the 15th
  • # — nth occurrence: 5#3 = 3rd Friday of month

Common Patterns

# Every minute
* * * * *

# Every 5 minutes
*/5 * * * *

# Every hour at minute 0
0 * * * *

# Every day at midnight UTC
0 0 * * *

# Every day at 9:30 AM
30 9 * * *

# Weekdays at 8 AM
0 8 * * 1-5

# Every Monday at noon
0 12 * * 1

# First day of every month at midnight
0 0 1 * *

# Every 6 hours
0 */6 * * *

# Twice a day (8 AM and 8 PM)
0 8,20 * * *

# Every Sunday at 2 AM
0 2 * * 0

# Every 15 minutes during business hours on weekdays
*/15 9-17 * * 1-5

Named Shortcuts (Vixie Cron)

@yearly   →  0 0 1 1 *    (once a year, Jan 1 midnight)
@monthly  →  0 0 1 * *    (once a month, 1st midnight)
@weekly   →  0 0 * * 0    (once a week, Sunday midnight)
@daily    →  0 0 * * *    (once a day at midnight)
@hourly   →  0 * * * *    (once an hour at minute 0)
@reboot              (runs at startup — only in system crontab)

Timezones in Cron

System cron runs in the server's local timezone. Cloud schedulers (AWS EventBridge, GCP Cloud Scheduler, GitHub Actions) default to UTC. This causes bugs when:

  • You deploy a server to a different region and forget the timezone changed.
  • Daylight saving time shifts your schedule by an hour twice a year.
  • You set a job for midnight but mean midnight in your local timezone, not UTC.

Best practice: Always schedule cron jobs in UTC and handle timezone conversion in your application code.

Platform-Specific Notes

GitHub Actions

on:
  schedule:
    - cron: "0 9 * * 1-5"  # 9 AM UTC weekdays

GitHub Actions uses 6-field cron (no seconds field). Minimum interval is 5 minutes. Jobs may run late during high load.

AWS EventBridge (CloudWatch Events)

# EventBridge uses its own cron syntax with year field:
cron(0 9 ? * MON-FRI *)
#         ^ ? means "any" for day-of-month when day-of-week is specified

Kubernetes CronJob

spec:
  schedule: "*/5 * * * *"  # Standard 5-field cron, UTC by default

Common Mistakes

  • */60 in the minute field — step values divide the range, so this fires only once (at 0). Use 0 * * * * instead.
  • Forgetting that day-of-week 0 and 7 are both Sunday.
  • Using day-of-week and day-of-month together — most implementations treat them as OR, not AND.
  • Clock skew: if your cron job runs slightly past a minute boundary, it might fire twice or not at all.

Parse & Explain Cron Expressions

Use ToolsVito's Cron Parser to paste any cron expression and instantly see a plain-English explanation plus the next 5 scheduled run times.

Try it now — free, runs in your browser

Cron Parser

Explain cron expressions