Skip to content

Cron expression builder and parser

Parse a Unix cron expression and see the next 10 times it fires, in local time and UTC. Use a preset or write your own. The description and the fire times update as you type. Everything runs in your browser.

Cron expression
0-59
0-23
1-31
1-12
0-6 (Sun-Sat)

Description

-

Next 10 fire times (local)

-

Next 10 fire times (UTC)

-

What is a cron expression?

A cron expression is a string of five fields that describes a repeating schedule. 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 or 7 means Sunday). Each field can be a single value, a comma separated list, a range, a step, or the wildcard *.

The format comes from the Unix cron daemon of the 1970s. It is short and powerful, but it is also easy to misread. That is why a tool that shows the next fire times is useful, even after you have written hundreds of them.

When to use this tool

  • Writing a new schedule. Type the expression and watch the next 10 fire times. If "weekdays at 9am" shows a Saturday, something is wrong.
  • Reading an expression from someone else. A vendor doc says 30 2 * * 1,5. The description here says "at 02:30 on Mon, Fri".
  • Checking a deploy schedule. "Daily clean up at midnight" is easy to say and hard to check. The UTC list matters when your servers run in UTC and your team does not.

The five fields

  • Minute (0-59). 0 means the top of the hour. */15 means every 15 minutes, starting at minute 0.
  • Hour (0-23). Always in the time zone of the cron daemon. For cloud schedulers this is usually UTC.
  • Day of month (1-31). Days that do not exist in a month (for example 30 February) are skipped without any warning.
  • Month (1-12). The names jan to dec also work.
  • Day of week (0-6). 0 is Sunday. The names sun to sat also work. 7 is also read as Sunday.

Day of month and day of week together

When both day of month and day of week are set, standard cron fires when EITHER one matches, not both. So 0 0 13 * 5 means "midnight on the 13th OR on any Friday". It fires more often than people expect. To get "the 13th only when it is a Friday", you need a check in your script. A cron expression cannot say it.

Worked examples

These are the outputs of this tool.

  • 30 2 * * 1,5 (the Sample button): "at 02:30 on Mon, Fri".
  • 0 9 * * 1-5: "at 09:00 on Mon, Tue, Wed, Thu, Fri". It never fires on Saturday or Sunday.
  • 0 0 13 * 5: "at 00:00 on Fri on day 13". It fires on every Friday and also on every 13th.
  • 15 9-17 * * *: "at minute 15 of hours 9, 10, 11, 12, 13, 14, 15, 16, 17". That is nine runs a day, at 09:15 to 17:15.
  • @hourly: the same as 0 * * * *, "at minute 0 of every hour".
  • 0 0 1 jan *: "at 00:00 in Jan on day 1". It fires once a year, so the list shows only the next 4 years.
  • 0 0 30 2 *: "at 00:00 in Feb on day 30". The expression is valid, but 30 February never comes, so the lists stay empty.

Common mistakes

  • Time zones. Most schedulers run in UTC. "Daily at 9am" written as 0 9 * * * fires at 9am UTC. That is 2am in US Pacific time and 2:30pm in IST. Use the local and UTC lists to check.
  • Lists and ranges. 1,2,3,4,5 is the same as 1-5. Both work. The range is easier to read.
  • Steps. */15 is fine. Some daemons reject a step like */15 in the day of month field. This tool reads the syntax as written.
  • Quartz style 6 or 7 fields. Java schedulers (Spring, Quartz) often add a seconds field at the front, so there are 6 fields. Some also add a year at the end. This tool takes 5 fields only. If you have 6, drop the seconds field at the front.
  • Fugit or Solid Queue text. A string like "every hour at minute 12" is not cron. It is Fugit syntax, used by Solid Queue in Ruby on Rails. This tool rejects it.

FAQ

Which cron format does this tool understand?

Standard 5-field Unix cron: minute, hour, day of month, month and day of week. Names like jan, feb, mon and tue work. The shortcuts @yearly, @annually, @monthly, @weekly, @daily, @midnight and @hourly also work.

Does it support 6-field Quartz or Spring cron, or 7-field cron?

No. Those add a seconds field at the front, a year field at the end, or both. Most backend cron is still 5-field.

Does it read Fugit text like "every hour at minute 12"?

No. Rails apps that use Solid Queue recurring tasks can use Fugit text, which needs its own parser. This tool handles only standard cron strings.

How are day of month and day of week combined?

The standard cron way. If both are set, the schedule matches on EITHER one. If only one is set, it matches on that one. If both are *, every day matches.

What is the difference between 0 and 7 for day of week?

Both mean Sunday. This tool accepts both and reads 7 as 0.