---
title: "How to write a cron expression for any schedule | ToolSugar"
description: "Build a 5-field cron expression, read it in plain English, and check the next five run times before you put the job on a server."
canonical: https://toolsugar.com/blog/how-to-write-a-cron-expression
image: https://toolsugar.com/og.png
---

# How to write a cron expression and check when it runs

Updated 2026-11-09

To write a cron expression, fill five fields in order: minute, hour, day of month, month and day of week. Cron Expression Generator builds the expression in your browser, explains it in plain English, and lists the next five run times in your local timezone. Check those times before the job goes anywhere near production.

[Open Cron Expression Generator](https://toolsugar.com/tools/cron-generator)

## Build a cron expression in four steps

You can start from a preset, edit single fields, or paste an expression you found in an old config.

1. Pick a preset or edit the Minute, Hour, Day of month, Month and Day of week fields.
2. Or paste an existing expression into the Cron expression box.
3. Read the plain English description.
4. Check the next five run times and press Copy.

## Read the five fields

The order is minute, hour, day of month, month, day of week. So 30 2 \* \* 1 means 02:30 every Monday. A star means every value, a comma lists values, a dash gives a range, and a slash sets a step, so \*/15 in the minute field means every 15 minutes.

Month and weekday fields also take names such as JAN or MON. Weekdays count from Sunday as 0, and Sunday can also be written as 7 in many systems. Ranges are inclusive, so 9-17 in the hour field covers every hour from 09:00 to 17:00, and 1-5 in the weekday field means Monday to Friday. Combine them as 0 9-17 \* \* 1-5 for the top of each working hour.

## When day of month and day of week are both set

This catches many people. If you set both fields to something other than a star, the job runs when either one matches. 0 9 1 \* 1 runs at 09:00 on the first of the month and also on every Monday.

To run only on Mondays, leave day of month as a star.

## Which timezone the times use

The next run times are computed in your device's local timezone. A server often runs cron in UTC, so the same expression fires at a different local hour there. Convert before you trust the list. Daylight saving time adds another trap. A job at 02:30 may be skipped or run twice on the days the clock changes in a local zone, so pick a time away from the shift for anything that must run once.

## What this generator leaves out

Some schedulers add a seconds field or a year, or special characters such as ? L W and #. This tool covers the standard 5-field format only, and it tells you when the input is invalid.

## Questions

### How do I run a job every 5 minutes?

Use \*/5 in the minute field and a star in the rest, giving \*/5 \* \* \* \*.

### How do I run something once a day at midnight?

Set minute 0 and hour 0 with stars in the other three fields, which gives 0 0 \* \* \*.

### Why does my command work in a terminal but fail in cron?

Cron starts jobs with a minimal PATH, so a bare command like node may not be found. Write the full path to the program and to any script it runs.

### Why did my job not run when I expected?

Check the server timezone first, then check whether both day fields are set. Either can cause a run you did not plan.

[Open Cron Expression Generator](https://toolsugar.com/tools/cron-generator)

## Related guides

- [How to generate UUIDs in bulk (v4 and v7)](https://toolsugar.com/blog/how-to-generate-a-uuid)
- [How to compare two texts and find the differences](https://toolsugar.com/blog/how-to-compare-two-text-files)
- [How to decode a JWT and read its claims](https://toolsugar.com/blog/how-to-decode-a-jwt)
