⏰ Cron Expression Generator

Last updated: December 23, 2025

⏰ Cron Expression Generator

Build schedules visually, decode any cron expression into plain English, and preview upcoming run times.

Fields:
Field 1
*
Minute
Field 2
*
Hour
Field 3
*
Day of Month
Field 4
*
Month
Field 5
*
Day of Week

Select a field above to configure it

* * * * *
Copied!
Every minute

Next 5 Run Times (UTC)

Paste any 5-field or 6-field cron expression to see what it means and when it will next run.

Click any preset to load it into the builder.

How to Use a Cron Expression Generator to Schedule Tasks Like a Pro

If you have ever deployed a web application, set up a server, or worked with any kind of automated pipeline, you have almost certainly encountered cron — the Unix job scheduler that has been quietly running the internet's back-end machinery since the 1970s. At first glance, a cron expression like 0 9 * * 1-5 looks like someone fell asleep on the keyboard. But once you understand the structure, cron becomes one of the most expressive and reliable scheduling tools available to developers.

This tutorial walks you through cron expressions from the ground up: what each field means, how to build them visually, how to read them back in plain English, and the real-world patterns that appear over and over in production systems.

The Anatomy of a Cron Expression

A standard cron expression consists of five space-separated fields that together specify exactly when a job should fire. From left to right those fields are: minute, hour, day-of-month, month, and day-of-week. A six-field variant prepends a seconds field, which is used by schedulers such as Quartz (Java), Spring Boot, and many Node.js task runners, though it is not part of the traditional Unix cron format.

The five-field template looks like this:

┌───────────── minute (0–59)
│ ┌─────────── hour (0–23)
│ │ ┌───────── day of month (1–31)
│ │ │ ┌─────── month (1–12)
│ │ │ │ ┌───── day of week (0–6, Sunday=0)
│ │ │ │ │
* * * * *

Each field can hold a single value, a comma-separated list of values, a range with a hyphen, a step with a forward-slash, or the wildcard asterisk that means "every possible value."

Special Characters That Do the Heavy Lifting

Understanding the four special characters unlocks almost every scheduling pattern you will ever need:

The asterisk (*) means "every valid value." In the minute field * means every minute from 0 through 59. In the month field it means January through December. When all five fields are asterisks — * * * * * — the job runs once per minute, every minute, around the clock.

The slash (/) defines step values. Writing */5 in the minute field means "starting at 0, fire every 5 minutes" — so at :00, :05, :10, and so on. Writing 0 */4 * * * fires at midnight, 4 AM, 8 AM, noon, 4 PM, and 8 PM.

The hyphen (-) defines a range. 1-5 in the day-of-week field targets Monday through Friday. 9-17 in the hour field covers 9 AM through 5 PM. You can combine a range with a step: 0-30/10 in the minute field fires at :00, :10, :20, and :30.

The comma (,) creates a list of discrete values. 1,15 in the day-of-month field fires on the first and fifteenth. 0,6 in the day-of-week field targets Sunday and Saturday. You can freely mix ranges and lists: 1-5,0 means Monday through Friday plus Sunday.

Building Your First Ten Cron Expressions

The best way to internalize cron syntax is to translate common scheduling requirements into expressions manually, then verify them with a tool like the generator above.

Run every hour on the hour: 0 * * * * — minute is 0, everything else is wildcard.

Run every day at 2 AM for nightly backups: 0 2 * * * — minute 0, hour 2.

Run every weekday at 9 AM: 0 9 * * 1-5 — day-of-week restricted to Monday through Friday.

Run on the first of every month: 0 0 1 * * — midnight on the 1st of every month.

Run every 15 minutes during business hours on weekdays: */15 9-17 * * 1-5 — fires at :00, :15, :30, :45 during hours 9 through 17, only Monday–Friday.

Run twice a day, at 8 AM and 6 PM: 0 8,18 * * * — uses a comma list in the hour field.

Run the first Sunday of the month is where cron shows its limitations — standard cron cannot directly express "the first Sunday." The workaround is to combine a range in dom and dow, but results vary by cron implementation. This is the kind of edge case where a dedicated scheduler like AWS EventBridge or APScheduler is worth the overhead.

The Day-of-Month and Day-of-Week Interaction

One source of confusion that trips up many developers is how cron handles both the day-of-month and day-of-week fields simultaneously. When both fields contain specific values (not wildcards), most cron implementations treat the condition as an OR, not an AND. This means 0 0 15 * 1 fires at midnight on the 15th of every month, and also at midnight every Monday — not only on Mondays that fall on the 15th. If you want the intersection (only Mondays that are the 15th), you need to handle that logic in your script.

Six-Field Cron for Second-Level Precision

The Quartz scheduler, widely used in Java and Spring applications, prepends a seconds field to the standard five-field format. The six-field structure is sec min hour dom month dow. A Quartz expression of 0/30 * * * * ? fires every 30 seconds. The question mark (?) is a Quartz-specific placeholder meaning "no specific value," used to avoid ambiguity between the dom and dow fields when only one of them should be active.

When using the cron generator on this page, toggle to "6-field" mode to include the seconds field in your expression.

Common Pitfalls and How to Avoid Them

The most frequent mistake beginners make is confusing the hour field with a 12-hour clock. Cron uses a 24-hour format. 8 means 8 AM, and 20 means 8 PM. If you write 0 8 * * * expecting an evening run, your job fires at 8 AM instead.

The second common mistake is forgetting time zones. Cron always executes in the system's local time zone unless you explicitly configure otherwise. A job scheduled for 0 2 (2 AM) on a server running UTC will fire at a different local time than you might expect if your users are in another time zone. Cloud platforms like AWS EventBridge, GCP Cloud Scheduler, and GitHub Actions all support time zone configuration per scheduled job — use it.

The third pitfall is overlapping runs. If your job takes longer than the interval between runs — say you schedule a heavy database task every minute but it takes two minutes — multiple instances pile up. Always build concurrency controls into your scripts or configure your scheduler to skip if the previous instance is still running.

Using the Generator's Decode Feature

When you inherit a codebase or take over a server, you will often find cron expressions that nobody documented. The Decode tab in the generator above accepts any 5- or 6-field expression and translates it into plain English along with the next five scheduled run times. Paste in something like 30 6 1,15 * * and the tool will tell you it fires at 6:30 AM UTC on the 1st and 15th of every month, then show you exactly when those runs will happen relative to right now.

This makes auditing an unfamiliar system's scheduled jobs a much faster process. Run through each cron entry, paste it into the decoder, and within seconds you have a human-readable schedule you can document or refactor.

Where Cron Expressions Appear in the Modern Stack

Beyond the classic Unix crontab, cron syntax (or a close variant) appears in GitHub Actions workflow files under on.schedule.cron, AWS EventBridge rules, GCP Cloud Scheduler jobs, Kubernetes CronJob resources, Heroku Scheduler, Render's cron jobs, and most CI/CD systems. The core syntax is consistent enough that an expression you write for one platform usually works on another with minor adjustments — though always check whether the platform expects a five-field or six-field format and whether it uses 0 or 7 to represent Sunday.

Mastering cron expressions is one of those foundational skills that pays dividends across the entire lifecycle of a software project. Use the visual builder to draft, the decoder to verify, and the presets to short-circuit the most common scheduling tasks entirely.

FAQ

What do the five fields in a cron expression represent?
From left to right the fields are: minute (0–59), hour (0–23), day of month (1–31), month (1–12), and day of week (0–6, where 0 is Sunday). Each field can hold a single value, a comma-separated list, a hyphen-delimited range, a step value using a forward slash, or an asterisk meaning 'every valid value.'
What is the difference between a 5-field and a 6-field cron expression?
The standard Unix cron format uses 5 fields starting with minutes. The 6-field variant — used by Quartz, Spring, and many Node.js schedulers — prepends a seconds field (0–59) at the beginning, so the order becomes: second, minute, hour, day-of-month, month, day-of-week. When pasting an expression into the decoder, the tool detects which format you are using automatically.
How do I schedule a job to run every 15 minutes only during business hours on weekdays?
Use the expression */15 9-17 * * 1-5. The */15 in the minute field fires at :00, :15, :30, and :45. The 9-17 restricts the job to hours 9 AM through 5 PM. The 1-5 in the day-of-week field limits execution to Monday through Friday. This is one of the most common patterns for rate-limited API polling or status-check jobs.
Why do both the day-of-month and day-of-week fields seem to behave like OR instead of AND?
This is standard cron behaviour. When both fields contain specific values (not wildcards), most cron implementations treat the condition as a union — the job fires if either condition is true, not only when both match simultaneously. If you need the intersection (for example, only the Monday that falls on the 15th), the logic must be handled inside the script itself rather than in the cron expression.
How do I make a cron job run only in a specific time zone?
Traditional system cron runs in the server's local time zone, which you set at the OS level. Cloud schedulers offer per-job time zone settings: AWS EventBridge accepts an IANA time zone string in the rule, GCP Cloud Scheduler has a time zone field per job, and GitHub Actions supports the 'cron' trigger in UTC only. Always document the time zone assumption alongside any cron expression to avoid confusion when the server's locale changes.
What does */5 mean in the minute field versus writing 0,5,10,15,20,25,30,35,40,45,50,55?
Both produce exactly the same schedule — firing at every multiple of 5 minutes within each hour. The */5 step notation is simply a shorthand that the scheduler expands internally to the full list. Using the step notation is strongly preferred because it is more readable, less error-prone to type, and immediately communicates the intent (every N units) rather than making the reader count entries in a list.