Cron Expression Builder & Next Runs Calculator | Free Online Tool
What is a cron expression?
A cron expression is a compact schedule string used to run jobs on a repeating timetable (hourly, daily, weekdays at 9am, the first of the month, etc.). It’s common in Linux cron, CI/CD, serverless schedulers, and task queues. This tool explains a cron expression and shows the next run times so you can spot mistakes before you deploy.
How to use the Cron Builder
- Paste a cron expression: Use Standard (5 fields) for classic cron, or Quartz (6 fields) if your scheduler includes seconds.
- Pick a timezone: Choose Local to interpret in your browser’s timezone, or UTC to interpret in UTC.
- Review “next runs”: Verify the next 10 (or fewer/more) fire times match what you intended.
Why use this tool?
- Catch off‑by‑one mistakes: Cron schedules are easy to misread (especially around weekdays vs day‑of‑month rules).
- Confirm timezone behavior: “2am daily” can mean different things depending on where it’s evaluated.
- Reduce production surprises: Seeing upcoming run times is often faster than mentally simulating the schedule.
Use case 1: Scheduling background jobs
When you’re adding a nightly cleanup job or a weekly report, the next-run list is a quick sanity check that you’re not accidentally running it every minute.
Use case 2: CI/CD and cron‑driven workflows
GitHub Actions, GitLab CI, and other systems use cron-like syntax for scheduled runs. This tool helps confirm the schedule is correct before you commit it.
Use case 3: Email and marketing automation
If you schedule sends (“every weekday at 9:15”), verify it in local time and UTC so you don’t blast a list at the wrong hour.
Examples
Basic example (standard 5-field cron)
Expression: 0 9 * * 1-5
Meaning: Weekdays at 09:00
Notes: In standard cron, fields are minute hour day-of-month month day-of-week.
Advanced example (every 5 minutes, Quartz with seconds)
Expression (Quartz): 0 */5 * * * ?
Meaning: Every 5 minutes at second 0
Notes: In Quartz mode, fields are second minute hour day-of-month month day-of-week and ? means “not specified”.
Advanced example (first day of month at 02:30)
Expression: 30 2 1 * *
Meaning: At 02:30 on day 1 of every month
Tip: If you also restrict day-of-week in standard cron, remember it can change the matching rules (see below).
Common errors
“Wrong number of fields”
Standard cron uses 5 fields:
minute hour day-of-month month day-of-week
Quartz-style cron commonly uses 6 fields (seconds added at the front), and sometimes a 7th year field depending on your system:
second minute hour day-of-month month day-of-week [year]
If your scheduler expects Quartz, keep it in Quartz mode; otherwise, use Standard.
“Day-of-week numbers are confusing”
Different systems disagree about whether Sunday is 0, 1, or 7. This tool follows common conventions:
- Standard mode:
0(or7) = Sunday - Quartz mode:
1= Sunday,7= Saturday (and?is allowed)
If you’re unsure, prefer day names (like MON-FRI) in systems that support them.
“Why does day-of-month vs day-of-week behave oddly?”
Classic cron has a historical rule: if both day-of-month and day-of-week are restricted, many implementations treat it like an OR (“either matches”). That can surprise you if you intended an AND.
Quartz generally expects you to set one of those fields to ? so the other one controls the schedule.
Tips and proven approaches
- Pick a single timezone policy: Many teams schedule in UTC to avoid DST ambiguity. If you schedule in local time, test around daylight saving transitions.
- Keep expressions readable: Add a comment next to the expression in your config (“Weekdays at 9am”), and store it in the online notepad while iterating.
- Validate before shipping: Paste the final expression here and confirm the next run times match your expectation. For quick experiments, generate candidate dates with the random date generator.
Related tools
- Save and share schedules in the online notepad when you’re reviewing cron changes with teammates.
- Generate test inputs with the random date generator for documentation or examples.
- If you need to sanity-check a complex string pattern, the regex tester is useful alongside cron work.
Privacy and security
Cron parsing and next-run evaluation happen locally in your browser. No schedules are uploaded by this tool. If the schedule relates to sensitive operations (billing, auth cleanup, backups), treat the output as a verification step—not a substitute for observing behavior in a staging environment.