Cron Expression Syntax Reference

Complete cron expression syntax guide with field reference, special characters, and examples. Build and validate cron schedules for Linux crontab, AWS EventBridge, Kubernetes, and GitHub Actions.

Build Valid Cron Expressions

Use the cron expression generator to interactively build and validate cron schedules. The generator shows a human-readable description of your expression and lists the next 5 run times.

  • Interactive builder: Set each field visually and see the expression update live
  • Human-readable output: "Every weekday at 9:00 AM" instead of 0 9 * * 1-5
  • Next run times: See the next 5 scheduled executions to verify correctness
  • Platform presets: Switch between Unix cron, AWS EventBridge, and Quartz syntax

Cron Field Reference

  • Field order (Unix): minute hour day-of-month month day-of-week โ€” e.g., 30 9 * * 1-5 = 9:30am weekdays
  • 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 both = Sunday) or SUNโ€“SAT

Special Characters

  • * (any): Matches every value in the field โ€” * * * * * runs every minute
  • , (list): Multiple values โ€” 0 9,17 * * * runs at 9am and 5pm
  • - (range): Inclusive range โ€” 0 9 * * 1-5 runs at 9am Monday through Friday
  • / (step): Every N units โ€” */15 * * * * runs every 15 minutes; 0 8-18/2 * * * runs every 2 hours from 8amโ€“6pm
  • L (last): Last day of month or last occurrence of a weekday โ€” 0 0 L * * runs midnight on the last day of each month (not all implementations)
  • ? (no specific value): Used in day-of-month or day-of-week when the other is specified โ€” required by AWS EventBridge and Quartz

Frequently Asked Questions

What is the minimum cron interval?

Standard Unix cron has a minimum interval of 1 minute โ€” * * * * * runs every minute. Sub-minute scheduling isn't supported in standard crontab. For sub-minute intervals, use a different tool: systemd timers (with OnCalendar=*:*:0/30 for every 30 seconds), a job queue (Sidekiq, Celery, BullMQ), or a sleep loop in a long-running process. AWS EventBridge's minimum rate is also 1 minute; GitHub Actions' minimum is 5 minutes.

Why does my cron job run at the wrong time?

The most common cause is timezone mismatch. Crontab runs in the system's local timezone by default โ€” check with date and timedatectl on Linux. To force a specific timezone, add TZ=America/New_York at the top of your crontab file. Cloud schedulers (AWS EventBridge classic, GitHub Actions) always run in UTC โ€” convert local time to UTC before writing the expression. Off-by-one errors in day-of-week numbering (0 vs 7 for Sunday) are another common source of unexpected behavior.

How do I run a cron job every 30 minutes?

*/30 * * * * or equivalently 0,30 * * * * โ€” both run at :00 and :30 of every hour. The */30 step syntax means "every 30 minutes starting from 0," which aligns to clock boundaries. If you want the job to start 15 minutes after the hour instead: 15,45 * * * *.