Cron Expression Generator
Build cron schedule expressions visually. See a human-readable description and the next execution times — no more guessing at cron syntax.
What Is a Cron Expression?
A cron expression is a string of five fields separated by spaces that defines a schedule for automated task execution. Cron is the time-based job scheduler found in Unix-like operating systems (Linux, macOS) and is widely used by developers and system administrators to automate repetitive tasks — from database backups and log rotation to sending email reports and clearing caches. Despite being decades old, cron remains one of the most reliable and widely deployed scheduling systems in production environments.
The Five Fields Explained
A standard cron expression has five fields, each representing a unit of time:
- Minute (0–59): Which minute of the hour the job should run.
- Hour (0–23): Which hour of the day (24-hour format).
- Day of Month (1–31): Which day of the month.
- Month (1–12): Which month of the year.
- Day of Week (0–7): Which day of the week (0 and 7 both represent Sunday).
Special Characters and Operators
Cron supports several special characters that make schedules flexible:
- Asterisk (*) — matches every value.
* * * * *runs every minute. - Comma (,) — lists multiple values.
0,30 * * * *runs at minute 0 and 30. - Hyphen (-) — defines a range.
9-17 * * * 1-5runs every hour from 9AM to 5PM on weekdays. - Slash (/) — step values.
*/15 * * * *runs every 15 minutes.
Common Cron Scheduling Pitfalls
Writing cron expressions by hand is error-prone. A common mistake is confusing the day-of-month and day-of-week fields — if both are specified (not *), the job runs when either condition is met, which often surprises newcomers. Another pitfall is forgetting that cron uses the server's local timezone, so a job scheduled for "midnight UTC" may run at an unexpected hour. Our visual generator eliminates these mistakes by showing you exactly what each field means and displaying a plain-English description of the resulting schedule.
Where Cron Expressions Are Used
Beyond traditional Unix crontab files, cron-style scheduling appears in many modern tools: GitHub Actions uses cron syntax for workflow triggers, Kubernetes CronJobs schedule containerized workloads, Jenkins uses cron for build triggers, and cloud providers like AWS (EventBridge) and GCP (Cloud Scheduler) all support cron expressions. Mastering cron syntax is a transferable skill that spans the entire DevOps landscape.
Pro Tips for Cron Scheduling
- Use preset buttons as learning tools — click a preset, then observe how each dropdown changes. The "Every Monday 9AM" preset sets minute=0, hour=9, day-of-week=Monday. Learn by deconstructing.
- Verify with "Next 5 execution times" — always check the preview list before pasting into production. A common mistake:
0 0 * * 0runs Sundays at midnight, not "first day of the week" as some expect. - Test in staging first — when moving cron expressions between environments (local dev → CI/CD → production), timezone differences can shift execution by hours. Verify with a test run.
FAQ
- Q: What's the difference between
*/5and0,5,10,15,...? - Functionally none.
*/5is shorthand for "every 5 minutes" and is equivalent to listing all multiples of 5. Use*/stepfor cleaner, more maintainable crontab entries. - Q: Can I schedule a job for the last day of the month?
- Standard cron doesn't support "last day" natively. Workaround: schedule the job to run on days 28–31 (
0 0 28-31 * *) and have your script check if tomorrow's date is the 1st. Some modern schedulers (like GitHub Actions) supportLsyntax. - Q: Why does my cron job run twice when I specify both day-of-month and day-of-week?
- When both fields are set (not *), cron uses OR logic — the job fires when either condition matches. To restrict further, leave one field as * and use your script to do additional date filtering.
- Q: How does cron handle Daylight Saving Time (DST) changes?
- Cron doesn't — it runs on wall-clock time. When clocks spring forward, jobs scheduled during the skipped hour (e.g., 2:30 AM) won't run that day. When clocks fall back, jobs in the repeated hour run twice. For DST-safe scheduling, either use UTC (recommended for servers) or set your crontab's
TZvariable to a timezone without DST likeEtc/UTC. - Q: Can I use this for GitHub Actions or Kubernetes CronJob schedules?
- Yes! Both GitHub Actions (
scheduletrigger) and Kubernetes CronJobs use standard 5-field cron syntax — exactly what this generator produces. The human-readable description and next-run preview work the same regardless of where you paste the expression. Note: some platforms add optional fields (seconds, year), but 5-field is the universal baseline. - Q: What are the
@daily,@hourly, and@rebootshortcut strings? - Traditional crontab supports eight special string shortcuts that replace the five-field syntax:
@reboot(run once at startup),@yearly/@annually(0 0 1 1 *),@monthly(0 0 1 * *),@weekly(0 0 * * 0),@daily/@midnight(0 0 * * *), and@hourly(0 * * * *). These work in Vixie cron (Linux/macOS) but are NOT supported in GitHub Actions, Kubernetes CronJobs, or Docker cron — those require explicit 5-field expressions. Use the visual generator above to produce standard syntax that works everywhere.
Why Use Our Cron Generator?
Our visual builder lets you construct cron expressions without memorizing field order or numeric ranges. Each dropdown shows valid values, and the human-readable description confirms your intent before you paste the expression into a crontab or CI/CD config. The next-execution-times preview lets you verify that "every Monday at 9AM" really does fall on Monday — not Sunday, which is a common off-by-one error. Save time, avoid midnight pages, and never guess at cron syntax again.