Cron Expression Explainer
Paste any cron expression and instantly get a plain English explanation with field breakdown and next run times.
Decode Cron Expression
What Is a Cron Expression?
A cron expression is a compact, five-field string that defines a recurring schedule for automated tasks. Originally introduced in Unix Version 7 (1979), cron remains the standard scheduling mechanism across Linux servers, cloud platforms, and CI/CD pipelines worldwide. The five fields — minute, hour, day of month, month, and day of week — are separated by spaces and read left to right. Together they answer one question: “When should this task run?”
Cron expressions power everything from database backups and log rotation to email digests and health-check pings. Despite their brevity, they can describe remarkably complex schedules: “every 15 minutes on weekdays,” “at midnight on the first of every quarter,” or “every Sunday at 3 AM in January through March.” This tool decodes any standard five-field expression into plain English so you can verify your schedule before deploying it.
The 5 Fields Explained
Minute (0–59): The exact minute within the hour when the job fires. A value of 0 means the top of the hour; */5 means every five minutes.
Hour (0–23): Uses 24-hour time. 0 is midnight, 12 is noon, 17 is 5 PM.
Day of Month (1–31): The calendar date. Be careful with 31 — months with fewer days will simply skip that run.
Month (1–12): January is 1, December is 12. Some implementations accept three-letter abbreviations (JAN, FEB), but numeric values are universal.
Day of Week (0–7): Both 0 and 7 represent Sunday. Monday is 1 through Saturday which is 6. When both day-of-month and day-of-week are restricted (not *), standard cron matches either condition — a common source of confusion.
Common Cron Expression Examples
* * * * * — Every minute. Often used for queue workers or health checks that need near-real-time responsiveness.
0 * * * * — Every hour, on the hour. A good cadence for hourly data syncs, cache invalidation, or aggregation jobs.
0 0 * * * — Daily at midnight. The classic schedule for backups, cleanup scripts, and daily report generation.
0 9 * * 1-5 — Every weekday at 9:00 AM. Ideal for business-hours notifications, standup reminders, or weekday-only ETL jobs.
*/15 * * * * — Every 15 minutes. Common for monitoring, polling external APIs, or refreshing dashboard data.
0 0 1 * * — First day of every month at midnight. Monthly billing cycles, invoice generation, or quota resets.
0 0 * * 0 — Every Sunday at midnight. Weekly report digests, full backups, or weekly maintenance windows.
Where Cron Expressions Are Used
Cron syntax has spread far beyond the original Unix crontab. Kubernetes CronJobs use the same five-field format in pod scheduling manifests. AWS EventBridge (formerly CloudWatch Events) accepts cron expressions to trigger Lambda functions and Step Functions. GitHub Actions supports cron in the schedule trigger for workflows — perfect for nightly builds, scheduled dependency updates, or periodic security scans. Google Cloud Scheduler, Azure Logic Apps, Jenkins, Airflow, and GitLab CI/CD all understand standard cron. Learning this one syntax unlocks scheduling across virtually every modern platform.
Frequently Asked Questions
- What is a cron expression?
- A cron expression is a five-field string that defines when a scheduled task should run. The fields represent minute, hour, day of month, month, and day of week. It is used by Unix crontab, Kubernetes, AWS, GitHub Actions, and many other platforms to automate recurring jobs.
- What are the 5 fields in a cron expression?
- Minute (0–59), Hour (0–23), Day of Month (1–31), Month (1–12), and Day of Week (0–7, where 0 and 7 both mean Sunday). Fields are separated by spaces and read left to right.
- How do I write a cron expression for every day at midnight?
- Use
0 0 * * *. The first0sets the minute, the second0sets the hour to midnight, and the three asterisks mean every day, every month, every weekday. - What does */5 mean in a cron expression?
- The
*/5syntax means “every 5th unit.” In the minute field it fires at :00, :05, :10, :15, and so on. The slash is the step operator that divides the range into equal intervals. - What is the difference between cron and crontab?
- Cron is the daemon (background service) that executes scheduled tasks. Crontab (cron table) is the configuration file listing those tasks. You edit it with
crontab -e. Each line contains a cron expression followed by the command to run. - How do I test a cron expression?
- Paste your expression into this tool to see the plain English explanation and the next 5 scheduled run times. This lets you verify the schedule matches your intent before deploying. You can also create a short-interval test job locally and check its log output.