WebToolsHub Logo
WebToolsHubOnline Tool Suite

Cron Job Expression Generator & Explainer

Stop guessing whether 0 */6 * * 1-5 runs every 6 hours or every 6 minutes. Paste any cron schedule to translate it into plain English, tweak fields visually with common presets, and preview the exact next 5 run timestamps across Linux crontab, GitHub Actions, Vercel Cron Jobs, and AWS EventBridge.

100% Client-Side • Free • Updated

What Is a Cron Expression and Why Small Syntax Mistakes Break Production?

A cron expression is a compact, space-separated string originally created for the Unix cron daemon in the 1970s to automate recurring background jobs. Today it remains the universal scheduling language powering Linux server crontabs, Kubernetes CronJob manifests, GitHub Actions scheduled workflows, Vercel Cron routes, Cloudflare Workers triggers, and PostgreSQL extensions like pg_cron.

Despite its age, one misplaced asterisk or misunderstood slash operator causes real outages: billing scripts running every minute instead of once an hour, database vacuums firing during peak traffic, or weekend backups silently skipped because two date fields conflicted. Our visual Cron Job Expression Generator eliminates trial-and-error deploys by decoding any string into human language and computing the next 5 concrete execution dates immediately inside your browser.

Anatomy of the Standard 5-Field Cron Format

Classic Unix and cloud HTTP schedulers (including GitHub Actions and Vercel Cron) use five positional fields separated by spaces. Left to right, they represent increasing units of time:

┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
│ │ │ │ ┌───────────── day of week (0 - 6 or SUN-SAT, 0 or 7 = Sunday)
│ │ │ │ │
* * * * *

Every field accepts wildcards, lists, ranges, and step increments. Understanding these four special operators covers 99% of real-world schedules:

  • Asterisk (*): Matches every possible valid value in that column. Five asterisks (* * * * *) triggers once every single minute.
  • Comma List (,): Specifies discrete values. Placing 0,15,30,45 in the minute slot runs on the quarter-hour marks.
  • Hyphen Range (-): Defines an inclusive interval. Setting hours to 9-17 runs during standard 9 AM to 5 PM business hours.
  • Slash Step (/): Steps across a base range at fixed intervals. */10 in minutes runs every 10 minutes (0, 10, 20, 30, 40, 50), while 10-50/15 runs at minutes 10, 25, 40.

Platform Differences: Linux Crontab vs. GitHub Actions vs. Vercel vs. AWS EventBridge

Before copying a working Linux expression into a SaaS CI/CD runner or serverless provider, check dialect subtle differences so deployments never reject your configuration.

Platform / Scheduler Field Count Timezone Default Key Dialect Quirk to Watch
Linux Crontab / Ubuntu 5 fields (+ optional @daily macros) Server local timezone (often UTC) 0 and 7 both mean Sunday; requires escaping % in commands.
GitHub Actions (schedule:) 5 fields (strict POSIX) Always UTC Shortest interval is 5 minutes; queues can delay execution during top-of-hour spikes.
Vercel Cron Jobs (vercel.json) 5 fields Always UTC Pro/Hobby tiers restrict minimum frequency and require CRON_SECRET bearer auth checks.
Kubernetes CronJob 5 fields (+ optional CRON_TZ) Controller-manager TZ unless specified Supports timeZone field directly in modern K8s clusters (v1.27+).
AWS EventBridge / Spring 6 fields (adds seconds or year) UTC (EventBridge configurable) Requires ? in either Day-of-Month or Day-of-Week when specifying the other.

Production Cron Examples Ready to Copy

Keep these battle-tested schedules on hand when wiring webhooks, cache warmers, or ledger jobs:

  • */5 * * * * runs every 5 minutes, ideal for queue polling or lightweight health probes.
  • 17 * * * * runs once an hour at minute :17, dodging the global traffic stampede that hits external APIs at :00.
  • 30 2 * * * runs daily at 02:30 UTC, useful for nightly sitemap rebuilds or stale session cleanup.
  • 0 9 * * 1-5 fires Monday through Friday at 09:00 UTC for weekday analytics digest emails.
  • 0 0 1 * * runs on the first calendar day of every month at midnight UTC for invoicing and archival.

Four Classic Cron Traps That Catch Senior Engineers

1. Specifying Both Day-of-Month and Day-of-Week Together

In standard Vixie/POSIX cron, if you set both Day-of-Month (15) and Day-of-Week (1 for Monday) instead of leaving one as *, the scheduler evaluates an OR condition rather than AND. Your job fires on every 15th of the month plus every Monday all month long. Always leave one of those two columns as *, or check the weekday inside your handler script.

2. Overloading Minute Zero (Thundering Herd Stampede)

Millions of developers default to 0 * * * * or 0 0 * * *. At midnight UTC on shared cloud infrastructure like GitHub Actions runners or serverless edge gateways, cold starts and API rate-limit errors spike dramatically. Picking an off-peak minute such as 14 or 43 dramatically stabilizes execution latency.

3. Timezone Drift and Daylight Saving Gaps

Most managed cloud crons (Vercel, GitHub Actions, AWS CloudWatch) execute strictly in UTC year-round. If your cron triggers a customer report intended for 9:00 AM New York time, remember that UTC offset shifts from UTC-4 (EDT) in summer to UTC-5 (EST) in winter. Convert exact UNIX epoch run schedules cleanly with our Unix Timestamp Converter when auditing logs across zones.

4. Leaving Serverless Cron Endpoints Publicly Triggerable

On frameworks like Next.js App Router hosted on Vercel, cron routes are ordinary HTTP GET endpoints. Anyone discovering the path can spam it repeatedly unless you verify an authorization token or secret header. Use our JWT Secret Key Generator to mint high-entropy secret tokens for your CRON_SECRET environment variable, inspect response codes with the HTTP Status Code Lookup, and generate quick manual curl smoke tests using our cURL to Code Converter.

Extended Cron Syntax, Macros, and Non-Standard Shortcuts

While POSIX 5-field cron covers almost every cloud automation scenario cleanly, several Linux crond implementations (Vixie cron, systemd-cron) and legacy enterprise task runners support handy readability shortcuts and extended symbols. Knowing which extensions are portable prevents hard-to-spot deployment failures across environments:

  • Standard @ nicknames: Shortcuts such as @hourly (0 * * * *), @daily (0 0 * * *), @weekly (0 0 * * 0), @monthly (0 0 1 * *), and @yearly (0 0 1 1 *) work in standard Ubuntu/Debian crontabs and GitHub Actions, though raw 5-field numeric strings are strongly preferred in multi-cloud CI templates like vercel.json.
  • Last day & weekday modifiers (L, W, #): Schedulers built on Java Quartz, Hangfire, or AWS EventBridge allow L for the last day of the month, W for the nearest weekday, and 1#3 for the third Monday of each month. Classic Linux crontab rejects these letters, so always match the dialect supported by your target platform.
  • 6-field second-precision crons: Kubernetes clusters use 5 fields, whereas AWS EventBridge, Spring Boot @Scheduled, and Golang robfig/cron often expect 6 columns by prepending a leading seconds field or appending a year field.

Reliability Best Practices: Logging, Locking, and Idempotency

Writing the right schedule is only half of running resilient background automation. Once a cron job goes live, network hiccups, slow database locks, or overlapping executions can corrupt financial totals or exhaust worker queues unless you bake defensive safeguards directly into the job handler:

  1. Enforce overlap prevention: On VPS servers running classic crontab, wrap long scripts with flock -n /tmp/myjob.lock so a slow run never piles up parallel duplicate processes when the next tick fires. On serverless HTTP handlers, store a short-lived lock row or distributed mutex key with a strict TTL.
  2. Design every cron handler to be idempotent: Cloud platforms like AWS EventBridge and distributed workers guarantee at-least-once delivery rather than strict exactly-once execution. Using database unique constraints or processed-event cursor tables guarantees a retried tick will not bill customers or dispatch duplicate emails twice.
  3. Capture standard error streams and heartbeat alerts: Redirect cron script output carefully or post lightweight completion pings to health-check monitors so silent exit status failures do not go unnoticed for days.

Troubleshooting Silent Cron Failures on Linux and Cloud Hosts

When a freshly deployed schedule refuses to execute at the expected time, run through this quick diagnostic checklist before rewriting the expression:

  • Minimal PATH environment in crontab: Classic Linux cron invokes commands inside a stripped minimal shell (PATH=/usr/bin:/bin) that omits NVM Node binaries or virtualenvs. Always specify absolute binary paths such as /usr/local/bin/node inside crontab entries.
  • Unescaped % characters: Vixie cron treats unescaped percent signs inside commands (common inside shell date format strings like date +%Y-%m-%d) as newline boundaries unless escaped with a backslash (%).
  • Missing trailing newline: Some traditional UNIX crontab parsers silently ignore the final line of a file unless a trailing newline character exists at the end.

Example: Securing a Next.js App Router Cron Route Handler

// app/api/cron/cleanup/route.ts
import { NextResponse } from "next/server";

export async function GET(request: Request) {
  const authHeader = request.headers.get("authorization");
  if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {
    return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
  }
  // Idempotent job logic here
  return NextResponse.json({ ok: true, timestamp: new Date().toISOString() });
}

Need to validate patterns in logs produced by those background workers? Pair your workflow with the Regex Tester & Debugger and test database cleanup queries offline using the SQL Query Validator.

Frequently Asked Questions

What does 0 */6 * * * mean in cron?

It executes at minute 0 of every 6th hour throughout the day: 00:00, 06:00, 12:00, and 18:00 (UTC on most cloud hosts).

What is the minimum frequency for a standard cron job?

Standard 5-field cron has one-minute granularity (* * * * *). SaaS runners often impose higher minimums: GitHub Actions runs at most every 5 minutes, and Vercel Hobby limits cron frequency depending on your plan.

Why does AWS EventBridge reject my 5-field cron string?

AWS EventBridge uses 6 fields (including a trailing Year column) and forbids placing * in both Day-of-Month and Day-of-Week simultaneously. Replace one of those two asterisks with a question mark (?).

What is the difference between 0 and 7 for Sunday in cron?

In standard Linux Vixie cron, both 0 and 7 represent Sunday (with Monday as 1 through Saturday as 6). Some strict parsers accept only 0-6, so using 0 or named days like SUN is more portable.

Why didn't my GitHub Actions scheduled workflow run at the exact second?

GitHub Actions experiences high load at the start of every hour and triggers scheduled workflows with best-effort queueing, which can introduce 3 to 15 minute delays at minute :00.

How do I run a cron job on the last day of every month?

POSIX 5-field cron does not universally support an L flag, though Quartz and AWS EventBridge do. On standard Unix cron, schedule on days 28-31 and check tomorrow's date inside the script before running.

What timezone do Vercel and Cloudflare Cron triggers use?

Both Vercel Cron Jobs and Cloudflare Workers Cron Triggers evaluate schedules strictly in Coordinated Universal Time (UTC), regardless of where your users or project team reside.

Does this cron generator send my expressions to a server?

No. Parsing, English explanation, and the next 5 scheduled timestamp calculations execute entirely inside your browser with zero API calls.