Cron Special Characters

Complete reference for all special characters used in cron expressions.

Quick Reference: Special characters allow you to create complex scheduling patterns beyond simple numeric values.

Basic Special Characters

* Asterisk (Wildcard)

Matches any value in the field. Used when you don't want to restrict that time unit.

Examples:

* * * * * Every minute Try →
0 * * * * Every hour (at minute 0) Try →
30 9 * * * 9:30 AM every day Try →

, Comma (List Separator)

Allows you to specify multiple values for a field. Separates individual values or ranges.

Examples:

0 9,17 * * * 9 AM and 5 PM daily Try →
0 0 1,15 * * 1st and 15th of month Try →
0 0 * * 1,3,5 Monday, Wednesday, Friday Try →

- Hyphen (Range)

Specifies a range of values (inclusive). Both start and end values are included.

Examples:

0 9-17 * * * Every hour from 9 AM to 5 PM Try →
0 0 * * 1-5 Weekdays (Mon-Fri) Try →
0 0 1-7 * * First week of month Try →

/ Slash (Step Values)

Specifies step values for ranges. Format: start/step or */step

Examples:

*/15 * * * * Every 15 minutes Try →
0 */2 * * * Every 2 hours Try →
0 9-17/2 * * * Every 2 hours from 9 AM to 5 PM Try →

Advanced Special Characters

Note: These advanced characters are supported by some cron implementations (like Quartz) but not standard Unix cron.

L Last (Day of Month/Week)

In day-of-month field: Last day of the month.
In day-of-week field: Last occurrence of that day in the month.

Examples:

0 0 L * * → Last day of every month
0 0 * * 5L → Last Friday of every month

W Weekday (Nearest)

Finds the weekday (Monday-Friday) nearest to the given day.

Examples:

0 0 15W * * → Weekday nearest to 15th of month
0 0 LW * * → Last weekday of month

# Nth Occurrence

Specifies the Nth occurrence of a weekday in the month.

Examples:

0 0 * * 1#1 → First Monday of month
0 0 * * 5#3 → Third Friday of month

Combination Examples

Complex Business Hours

*/30 9-17 * * 1-5

Every 30 minutes during business hours (9 AM - 5 PM), weekdays only

Multiple Time Slots

0 9,12,15,18 * * *

At 9 AM, 12 PM, 3 PM, and 6 PM every day

Weekend + Weekday Pattern

0 8 * * 1-5 + 0 10 * * 0,6

8 AM on weekdays, 10 AM on weekends (requires two separate cron jobs)

Common Mistakes

❌ Mixing AND/OR Logic

0 0 15 * 1 ← This means "15th of month OR Monday"

Day-of-month and day-of-week are OR'ed, not AND'ed!

❌ Invalid Step Values

*/0 * * * * ← Invalid (division by zero)

Step value must be greater than 0

❌ Range Confusion

0 17-9 * * * ← This doesn't work as expected

Ranges can't wrap around. Use two separate entries.

🎯 Master Cron Expressions

Ready to put these special characters to work? Try our visual generator: