Cron Expression Generator

Expression input

Fields
Minute
Hour
Day
Month
Weekday
A value box accepts a single number 30, a list 0,30, a range 9-18 or a step */5. Weekdays and months also take three-letter names such as MON or JAN.
Cron expression
—
Meaning —

Next 5 run times

    Field-by-field breakdown

    Field Raw Meaning

    Cron Expression Generator features

    No syntax to memorise

    Each of the six fields gets a type selector — every, specific, range or step — and the expression is assembled for you, so nothing ends up in the wrong position

    Works in both directions

    Inherited a crontab full of expressions you do not recognise? Paste one in and it is translated into plain English with every field explained

    Real run times, not guesses

    The next five fire times are resolved from the current moment, with weekday and countdown. An empty list means the schedule never fires at all

    Five or six fields

    Linux crontab uses five fields, Quartz and Spring use six. Switch the count and the seconds field appears or disappears — no second tool needed

    Errors point at the field

    Out-of-range values, wrong field count and malformed syntax all report which field is wrong instead of quietly computing a wrong schedule

    Nothing leaves the browser

    Parsing and run-time resolution happen entirely in your browser. No expression is uploaded anywhere, and the tool works offline

    How to use the Cron Expression Generator

    1

    Pick the field count first

    Use 5 fields for a Linux crontab or a Docker cron container, 6 fields for Quartz or Spring's @Scheduled. Getting this wrong shifts the whole expression by one position, which is the most common beginner mistake.

    2

    Choose a type per field

    Leave a field unrestricted with the "every" option, or switch to specific for a single value, range for a span such as 9-18, and step for a fixed interval such as every 5.

    3

    Start from a preset

    Every five minutes, weekdays at 9 am, the 1st of each month — the preset chips fill all six fields at once, and adjusting one is faster than starting from an empty form.

    4

    Check the run times before deploying

    The next-five-runs list is the real acceptance test. If the dates look wrong your reading of the expression is wrong; if the list is empty the schedule can never fire, so do not ship it.

    Common uses

    Nightly server backups

    Run a database dump at 3 am and confirm with the preview that it lands at 3 am rather than 3 pm

    Polling jobs

    Fetch an API every five minutes with */5 * * * *, not 5 * * * * which silently fires once an hour

    Weekday-only reports

    Restrict a 9 am report to Monday through Friday with 1-5 in the weekday field, so nobody is paged on a weekend

    Inheriting someone's crontab

    Paste each unfamiliar line into the parser to find out what it actually does before changing anything

    Debugging a job that never runs

    If the next-run list is empty, the date combination does not exist — a 31st of February, for instance

    Teaching the quirks

    Run the OR rule between day-of-month and day-of-week as a live example; it sticks far better than reading the docs

    Cron syntax explained

    The five fields and their ranges

    Cron's five fields, left to right, are minute (0-59), hour (0-23), day of month (1-31), month (1-12) and day of week (0-6, where 0 and 7 are both Sunday). The order deliberately puts the finest granularity first, so the leftmost field changes most often. The classic beginner error is swapping month and day, because the fourth field is the month and the third is the day — the opposite of how dates are usually written. The six-field variant prepends a seconds field (0-59), which most Linux crontabs do not support; it belongs to the Quartz family.

    Wildcards, lists, ranges and steps

    Four building blocks combine into every expression. An asterisk * matches every value in the field. A comma , lists values, so 1,15 means the 1st and the 15th. A hyphen - spans a contiguous range, so 9-18 means 9 am through 6 pm. A slash / sets a step, so */5 means every 5 units starting from the minimum. A step can carry an explicit start, so 5/15 starts at 5 and repeats every 15. These compose: 1-30/2 is every odd day up to 30, and 1,15-20 is the 1st plus the 15th through the 20th.

    The OR rule between day and weekday

    This is cron's most counter-intuitive rule: when both the day-of-month and day-of-week fields are restricted (neither is *), they are combined with OR, not AND. So 0 0 1 * 1 runs at midnight on the 1st of every month and on every Monday, which can be five or six times a month. If you genuinely need "the 1st, but only when it is a Monday", cron cannot express it; leave the weekday as * and test the date inside the script. The safe habit is to restrict exactly one of the two fields and leave the other as *.

    Why some expressions never fire

    Cron does not validate calendar dates. Writing 0 0 31 2 * only checks that 31 is within 1-31, accepts it, and then waits forever for a February 31st that never arrives — the job silently never runs. The same happens with 0 0 30 2 *. Conversely 0 0 29 2 * is valid but only fires in leap years. The signature of this problem is a schedule that looks correct with nothing in the logs; the first diagnostic step is always to check whether the next-run list is empty.

    Time zones and containers

    Cron uses the server's system time zone. The same 0 9 * * * fires at 5 pm Beijing time on a UTC host and at 9 am only on an Asia/Shanghai host. Containers are the usual source of trouble: nearly every base image defaults to UTC, so a schedule that tested fine locally shifts by the offset once deployed. Set the TZ environment variable and install tzdata in the image, or use CRON_TZ at the top of the crontab file. On daylight-saving transition days, jobs scheduled between 2 am and 3 am may be skipped or run twice.

    Cron syntax cheat sheet

    Field Required Allowed values Special characters
    Second (6-field only)Yes0-59* , - /
    MinuteYes0-59* , - /
    HourYes0-23* , - /
    Day of monthYes1-31* , - / ?
    MonthYes1-12 or JAN-DEC* , - /
    Day of weekYes0-7 or SUN-SAT (0 and 7 are Sunday)* , - / ?
    Common patterns: */5 * * * * every 5 minutes · 0 * * * * hourly on the hour · 0 3 * * * daily at 3 am · 0 9 * * 1-5 weekdays at 9 am · 0 0 1 * * the 1st of each month · 0 0 1 1 * January 1st

    Frequently asked questions

    Q: What do the five cron fields mean?
    A: Left to right they are minute, hour, day of month, month, day of week. So 30 9 * * 1 means 09:30 every Monday. The order is not year-month-day: the fourth field is the month and the third is the day, which is the reverse of how most people write dates. The six-field form adds a seconds field at the very front and is common in Quartz and Spring's @Scheduled.
    Q: When both day-of-month and day-of-week are set, is it AND or OR?
    A: It is OR. In standard cron, if both the day-of-month and day-of-week fields are restricted, the job runs when either one matches. So 0 0 1 * 1 fires at midnight on the 1st of every month and also every Monday, not only on Mondays that happen to be the 1st. To get AND semantics, leave one of them as * and check the other condition inside your script.
    Q: Why does 5 * * * * not mean every five minutes?
    A: Because 5 * * * * means at minute 5 of every hour, which fires only once an hour. To run every five minutes you need the step syntax */5 * * * *, where the number before the slash is the start and the number after is the interval. Likewise */10 is every ten minutes and 0 */2 * * * is every two hours on the hour. Writing 5/15 means starting at minute 5 and repeating every 15 minutes.
    Q: Is day-of-week 7 the same as 0?
    A: Yes, both mean Sunday. Cron numbers weekdays 0 through 6 with 0 as Sunday, and 7 is also accepted as Sunday for compatibility with the convention of listing Sunday last. So 0 0 * * 7 and 0 0 * * 0 are identical. Many implementations also accept three-letter names such as SUN or MON, written without quotes.
    Q: Why does 0 0 31 2 * never run?
    A: Because February has no 31st. Cron does not validate calendar dates, so it accepts the expression and then silently waits forever for a date that never arrives. The same applies to 0 0 30 2 *. February 29 is accepted, but it only fires in leap years, once every four years. When writing anything like this, check the next run times: an empty list is the warning sign.
    Q: Which time zone does cron use?
    A: The server's system time zone, not the time zone of whoever wrote the entry. On a server running in UTC, 0 9 * * * actually fires at 17:00 Beijing time. Some implementations let you put CRON_TZ=Asia/Shanghai at the top of the crontab file. Container images are the usual culprit: almost every base image defaults to UTC, so a schedule that looked right locally drifts by the offset once deployed.
    Q: Can five-field and six-field expressions be mixed?
    A: It depends on the runtime. Linux crontab accepts only five fields and treats a sixth as a syntax error. Quartz, Spring's @Scheduled and some cloud schedulers accept six, where the extra leading field is seconds. The difference is not just the field count: Quartz also requires a ? in either the day-of-month or the day-of-week field. Confirm the dialect before moving an expression to another platform.