Cron Expression Explainer & Visualizer
Paste any cron expression to get a plain-English explanation and the next 10 scheduled run times. Supports 5-field standard cron, 6-field (with seconds), and shorthand like @daily, @weekly, @monthly.
The Problem Cron Explainer Solves
Cron syntax has been in use since the 1970s and remains the dominant way to schedule recurring tasks in Linux environments, CI/CD pipelines, Kubernetes CronJobs, and cloud-native schedulers. Despite its ubiquity, the five-field format β like 0 2 * * 1 β is easy to misread, particularly when combining ranges, step values, and comma-separated lists. A wrong cron expression can cause a backup job to run every minute instead of once a night, or cause a database maintenance task to fire at peak traffic hours.
This explainer translates cryptic cron strings into plain-English descriptions ("At 2:00 AM every Monday") and shows the next several scheduled run times, eliminating the guesswork when writing or reviewing scheduled jobs. Verifying expressions before deploying them is a simple habit that prevents costly incidents.
How It Works Under the Hood
The explainer parses each of the five cron fields β minute, hour, day-of-month, month, and day-of-week β using the standard Unix cron grammar, which supports wildcards (*), ranges (1-5), step values (*/15), and lists (1,15,30). It then builds a natural-language description by walking the field constraints from left to right. Next-run times are computed by iterating forward from the current timestamp, incrementing minute by minute and testing each candidate datetime against all five field constraints until a match is found.
Real-World Use Cases
- Writing new schedules: Verify that the expression you've constructed runs at exactly the intended times before adding it to a crontab, GitHub Actions workflow, or Kubernetes CronJob manifest.
- Reviewing pull requests: Quickly parse an unfamiliar cron expression in a code review without needing to mentally step through the field rules.
- Debugging missed jobs: Confirm that a scheduled task's expression actually fires during your maintenance window and doesn't overlap with other critical jobs.
- Onboarding and documentation: Generate a human-readable description of a cron expression to include in runbook documentation so on-call engineers understand when automated tasks are expected to run.
Best Practices & Tips
- Avoid ambiguous overlap between day-of-month and day-of-week: When both fields are restricted (not
*), most cron implementations treat them as OR'd together, not AND'd β0 0 15 * 1runs both on the 15th of every month AND every Monday, which surprises people expecting "the 15th, but only if it's a Monday." Use this explainer to confirm the actual run set before deploying ambiguous expressions like this. - Always specify a timezone assumption explicitly in documentation: Standard crontab runs in the server's local time, while Kubernetes CronJobs default to UTC and AWS EventBridge Scheduler lets you set timezone per-rule β document which one applies next to every schedule so an on-call engineer doesn't misjudge "midnight" by several hours during an incident.
- Stagger overlapping jobs instead of stacking them at :00: Resist the urge to schedule every nightly job at
0 0 * * *; staggering start times (0 0,15,30,45 * * *spread across different jobs) avoids resource contention spikes when multiple cron-triggered batch jobs hit the same database or API simultaneously. - Build in idempotency before relying on cron for retries: Cron has no built-in retry or failure alerting β a job that crashes silently just doesn't run again until the next scheduled tick. Pair cron-triggered scripts with exit-code monitoring or a dead man's switch (a service that alerts if it doesn't hear a heartbeat by the expected time) rather than assuming silence means success.
Frequently Asked Questions
What is a cron expression?
A cron expression is a string of five whitespace-separated fields that defines a recurring schedule: minute (0β59), hour (0β23), day-of-month (1β31), month (1β12), and day-of-week (0β7, where both 0 and 7 represent Sunday). For example, 0 9 * * 1-5 means "at 9:00 AM every weekday". Cron was originally introduced in Unix Version 7 and remains the standard scheduling primitive across Linux systems, container orchestrators, CI/CD platforms, and cloud-native schedulers alike.
What does the asterisk (*) mean in cron?
The asterisk means "every possible value" for that field. So * * * * * means every minute of every hour of every day. You can combine the asterisk with a step value: */5 in the minute field means "every 5 minutes", while */2 in the hour field means "every 2 hours". You can also use ranges like 1-5 to match a consecutive span, or comma-separated lists like 0,15,30,45 to match specific values β all of which can be mixed in a single expression.
How does cron syntax differ between Linux cron and Kubernetes CronJobs?
Standard Linux cron uses five fields (minute, hour, day-of-month, month, day-of-week) and runs in the local timezone of the server. Kubernetes CronJob spec uses the same five-field format but schedules are evaluated in UTC by default, and the job may start up to a minute late due to the controller's reconciliation interval β this is important to account for when scheduling time-sensitive operations. Some systems such as AWS EventBridge Scheduler, Spring @Scheduled, and Quartz add a sixth seconds field at the beginning of the expression, making those expressions incompatible with standard cron parsers and requiring careful documentation when sharing expressions across teams.