Cron Calculator

Build and understand cron expressions for scheduling tasks. Get human-readable descriptions.

Cron Expression

0 * * * *

Runs every hour

Common Presets

Next 5 Runs

Fri, Jul 1701:00 PM

What Is a Cron Expression?

A cron expression is a compact, text-based schedule definition used by Unix-like operating systems, cloud platforms, and virtually every modern backend framework to trigger tasks at precise times. The name comes from cron, the time-based job scheduler built into Linux and macOS. When you want a script to run every night, every Monday morning, or at 9:15 AM on the first of each month, you encode that intent in a five-field cron string.

Each field in the expression represents a unit of time, read left to right: minute, hour, day-of-month, month, and day-of-week. Wildcards, ranges, lists, and step values let you express nearly any repeating schedule with just a handful of characters. The visual builder above converts your field choices into a valid expression in real time, and also translates raw expressions into plain-English descriptions so you can confirm the schedule does exactly what you intend.

Cron expressions are not just a Linux curiosity. They power AWS EventBridge, Google Cloud Scheduler, GitHub Actions schedules, Kubernetes CronJobs, Laravel's task scheduler, Django-celery-beat, and dozens of other production-grade tools. Learning to read and write them fluently is one of the highest-leverage DevOps skills you can develop.

The 5-Field Cron Expression Format

minute hour day-of-month month day-of-week

Where:

  • minute= 0–59 — the minute within the hour when the job fires
  • hour= 0–23 — the hour of the day (24-hour clock)
  • day-of-month= 1–31 — the calendar day of the month
  • month= 1–12 — the month of the year
  • day-of-week= 0–6 — the day of the week (0 = Sunday, 6 = Saturday)

Cron Syntax: Wildcards, Ranges, Steps, and Lists

Five special characters dramatically expand what a single cron field can express. Understanding them unlocks the full power of the cron calculator.

  • Asterisk (*) — matches every valid value in that field. * * * * * fires every single minute of every day.
  • Comma (,) — creates a list of specific values. 0,30 * * * * fires at minute 0 and minute 30 of every hour — twice per hour.
  • Hyphen (-) — defines an inclusive range. 9-17 in the hour field means hours 9 through 17 — the normal business day.
  • Slash (/) — defines a step interval. */15 in the minute field means every 15 minutes (0, 15, 30, 45). */2 in the hour field means every two hours.
  • Question mark (?) — supported by some implementations (Quartz, AWS) to mean "no specific value," useful when you specify day-of-week but not day-of-month.

These characters can be combined. 0 8-18/2 * * 1-5 fires every two hours between 8 AM and 6 PM, Monday through Friday. The cron expression builder translates your typed values through these same parsing rules to generate the description and preview the next five scheduled run times.

Field Range Example value Meaning
Minute 0–59 */5 Every 5 minutes
Hour 0–23 9-17 Hours 9 AM through 5 PM
Day of month 1–31 1,15 1st and 15th of each month
Month 1–12 3,6,9,12 March, June, September, December
Day of week 0–6 1-5 Monday through Friday

Common Cron Schedules and Their Expressions

Certain scheduling patterns appear so often in production systems that every developer should have them memorized. The following are the most widely used cron expressions, each of which you can load directly via the preset buttons in the calculator above.

Schedule Expression Use case
Every minute * * * * * Health checks, rapid polling
Every hour 0 * * * * Hourly aggregations, cache refresh
Every day at midnight 0 0 * * * Daily backups, report generation
Every Sunday at midnight 0 0 * * 0 Weekly maintenance windows
First of every month 0 0 1 * * Monthly invoices, billing runs
Weekdays at 9 AM 0 9 * * 1-5 Business-hours notifications
Every 15 minutes */15 * * * * Metrics collection, sync jobs
Every 6 hours 0 */6 * * * Periodic data exports

When selecting a schedule, consider server load distribution. If all your jobs run at exactly midnight (0 0 * * *), the server spike can be significant. Staggering jobs — for example 5 0 * * * and 15 0 * * * — distributes the load and reduces contention for shared resources like databases and APIs.

Cron vs. Modern Scheduling Alternatives

Classic crontab is the original Unix job scheduler, but modern infrastructure offers many alternatives. Understanding where cron excels — and where it falls short — helps you pick the right tool.

Crontab on Linux/macOS is the simplest option: edit /etc/crontab or run crontab -e and your job is scheduled. No external dependencies, no cost, no round-trips to a cloud API. It works perfectly for server-side scripts that must run on one predictable host. The downside is that there is no automatic retry on failure, no built-in alerting, and no execution history.

AWS EventBridge Scheduler supports both standard cron syntax and rate expressions (rate(5 minutes)). It can invoke Lambda functions, Step Functions, and hundreds of other AWS targets. AWS uses a slightly extended format where you must specify either day-of-month or day-of-week as ? (not both). EventBridge is the right choice when you need serverless, highly-available scheduling without managing any infrastructure.

Kubernetes CronJobs use standard five-field cron syntax to spin up pods on a schedule. They are ideal for containerized batch workloads that must scale with the cluster and benefit from Kubernetes restartPolicy and resource limits.

GitHub Actions schedules use the same five-field syntax in the on.schedule block, letting you trigger CI/CD pipelines on a recurring basis — useful for nightly builds, dependency audits, or automated releases.

For complex workflows with dependencies between steps, tools like Apache Airflow, Prefect, or Dagster extend cron concepts with DAG-based orchestration, retries, SLAs, and observability. Start with cron for simple use cases and graduate to these platforms as complexity grows.

Crontab Best Practices and Debugging Tips

Even a syntactically correct cron expression can produce unexpected behavior if you overlook a few key operational concerns. Follow these best practices to keep your scheduled jobs reliable.

Always specify the timezone explicitly. The system cron daemon runs in the server's local timezone, which might be UTC, Eastern Time, or something else entirely. Cloud schedulers like AWS EventBridge and Google Cloud Scheduler let you specify a timezone when creating the rule. If your crontab file does not support a CRON_TZ variable, wrap your command in a timezone-aware shell one-liner: TZ=America/New_York date.

Redirect output to a log file. By default, cron mails command output to the local user, which often goes unread. Add >> /var/log/myjob.log 2>&1 to the end of each command to capture both stdout and stderr in a persistent log file you can review after failures.

Use absolute paths. The cron daemon runs in a minimal environment with a restricted PATH. A script that works interactively may silently fail under cron if it references commands like node, python3, or aws without their full paths. Always write /usr/bin/node or /usr/local/bin/python3 in your cron commands.

Test expressions before deploying. Use this cron calculator to confirm the next five run times match your intent before editing production crontab files. A simple off-by-one in the hour field can turn a daily job into something that never fires — or fires 24 times a day.

Protect against overlapping runs. Long-running jobs may still be executing when the next scheduled run starts. Use a lock mechanism such as flock on Linux to prevent concurrent execution: flock -n /tmp/myjob.lock /path/to/script.sh.

Worked Examples

Database Backup at 2 AM Daily

Problem:

You want to run a database backup script every day at exactly 2:00 AM. What cron expression do you use?

Solution Steps:

  1. 1Set the minute field to 0 — the job fires at the top of the hour.
  2. 2Set the hour field to 2 — hour 2 in 24-hour format is 2:00 AM.
  3. 3Set day-of-month, month, and day-of-week all to * to match every day.
  4. 4The resulting expression is: 0 2 * * *
  5. 5Verify: the calculator description reads 'Runs at 2:00 AM' and the next runs all show 02:00 on consecutive days.

Result:

0 2 * * * — fires at 2:00 AM every day of the year.

Every 15 Minutes During Business Hours on Weekdays

Problem:

A metrics-collection script needs to run every 15 minutes between 8 AM and 5 PM, Monday through Friday only.

Solution Steps:

  1. 1Set the minute field to */15 — this matches minutes 0, 15, 30, and 45.
  2. 2Set the hour field to 8-17 — hours 8 through 17 cover 8:00 AM to 5:59 PM (inclusive).
  3. 3Leave day-of-month as * — any day is fine as long as the day-of-week matches.
  4. 4Leave month as * — run year-round.
  5. 5Set day-of-week to 1-5 — 1 is Monday, 5 is Friday; the range covers all weekdays.
  6. 6The resulting expression is: */15 8-17 * * 1-5

Result:

*/15 8-17 * * 1-5 — runs four times per hour (at :00, :15, :30, :45) from 8 AM to 5 PM, Monday through Friday.

Quarterly Report on the First of January, April, July, and October

Problem:

A quarterly report job should run once at midnight on the first day of each quarter: January 1, April 1, July 1, and October 1.

Solution Steps:

  1. 1Set minute to 0 and hour to 0 — midnight (00:00) is the target time.
  2. 2Set day-of-month to 1 — the first day of the month.
  3. 3Set month to 1,4,7,10 — a comma-separated list covering the four quarter-start months.
  4. 4Set day-of-week to * — any day of the week is fine since we are constraining by date.
  5. 5The resulting expression is: 0 0 1 1,4,7,10 *
  6. 6Verify: next runs show January 1, April 1, July 1, and October 1 at 00:00.

Result:

0 0 1 1,4,7,10 * — fires at midnight on the first day of January, April, July, and October.

Every Sunday at Midnight for Weekly Maintenance

Problem:

A maintenance window should open every Sunday at 12:00 AM to run cleanup scripts.

Solution Steps:

  1. 1Set minute to 0 and hour to 0 for midnight.
  2. 2Leave day-of-month and month as * — any date is acceptable.
  3. 3Set day-of-week to 0 — in cron, 0 represents Sunday.
  4. 4The resulting expression is: 0 0 * * 0
  5. 5This matches the 'Every Sunday' preset in the builder.

Result:

0 0 * * 0 — fires at midnight every Sunday.

Tips & Best Practices

  • Use */N in the minute field (e.g., */15) to run a job at regular intervals within each hour rather than listing every minute individually.
  • Always test a new cron expression in this calculator and verify the 'Next 5 Runs' preview before deploying to production — one wrong field can cause jobs to run 24x more or never at all.
  • Redirect cron output to a timestamped log file with >> /var/log/myjob.log 2>&1 so you have a history to audit when a job fails silently.
  • Use absolute paths in cron commands — cron runs with a minimal PATH, so /usr/bin/python3 instead of python3 prevents 'command not found' failures.
  • Stagger heavy jobs by a few minutes (e.g., 2 0 * * * instead of 0 0 * * *) to avoid thundering-herd spikes when multiple jobs all fire at midnight.
  • Use flock or another lock mechanism to prevent overlapping runs if a job takes longer than its scheduled interval.
  • Specify CRON_TZ=America/New_York at the top of your crontab or use a cloud scheduler's timezone setting to avoid daylight saving time surprises.
  • Add a MAILTO= line at the top of your crontab to redirect email output to a specific address (or set MAILTO='' to silence it entirely).

Frequently Asked Questions

An asterisk in any cron field means 'every possible value for that field.' In the minute field it means every minute (0–59); in the hour field it means every hour (0–23); and so on. A fully wildcarded expression <code>* * * * *</code> fires once per minute, every minute of every day. When combined with a step value like <code>*/5</code>, it means 'every 5th value' — in the minute field, that is minutes 0, 5, 10, 15, and so on.
Use the step syntax in the minute field: <code>*/5 * * * *</code>. This evaluates to minutes 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, and 55 — twelve times per hour, every hour, every day. You can verify this by entering <code>*/5 * * * *</code> in the expression mode of the cron calculator and reviewing the next five scheduled run times.
Standard five-field cron syntax is the same across Linux crontab, Google Cloud Scheduler, and GitHub Actions. AWS EventBridge uses a six-field extended format that adds a seconds field or a year field depending on the context, and it requires that exactly one of day-of-month or day-of-week is set to <code>?</code> rather than <code>*</code>. Quartz Scheduler (used in Java applications) also uses a six-field format with a seconds field prepended. Always check the documentation for the specific platform to confirm which variant it expects.
The most common causes are: (1) the command uses a relative path that is not available in cron's restricted environment — use absolute paths like <code>/usr/bin/python3</code>; (2) the job is running but output is silently discarded — redirect stderr and stdout to a log file with <code>&gt;&gt; /tmp/job.log 2&gt;&amp;1</code>; (3) a timezone mismatch — the server timezone may differ from what you expect; (4) the cron daemon is not running — verify with <code>systemctl status cron</code> or <code>service cron status</code> on Linux.
Day-of-month (field 3) targets a specific calendar date within a month, such as the 15th. Day-of-week (field 5) targets a recurring weekday, such as every Monday. When both fields are set to non-wildcard values in standard cron, the job fires when either condition is true — not both. For example, <code>0 0 15 * 1</code> fires on the 15th of each month AND on every Monday. If you need an AND condition (only on Mondays that fall on the 15th), cron does not support it natively; you would add a date-check inside the script itself.
Standard cron does not have a 'last day' token. The most common workaround is to schedule the job for the 28th, 29th, 30th, and 31st and add a shell condition that exits unless today is the actual last day: <code>[ $(date -d tomorrow +%d) = 01 ] || exit 0</code>. Some extended cron implementations and cloud schedulers (like AWS EventBridge) support the <code>L</code> token, which directly means 'last day of month.'
Standard five-field cron has minute-level granularity, so the most frequent a job can run is once per minute (<code>* * * * *</code>). For sub-minute scheduling, you need a different tool: a loop inside a long-running process, a systemd timer with seconds precision, or a task queue like Celery or Bull with sub-minute intervals. If you genuinely need second-level precision, Quartz Scheduler (Java) and some cloud schedulers support a six-field format with a leading seconds field.

Sources & References

Last updated: 2026-06-05

💡

Help us improve!

How would you rate the Cron Calculator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Standard Mathematical References

by Various

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.