Check a website's HTTP status code with curl
Print just the HTTP status code (200, 404, 500…) of any URL using the curl tool built into Windows.
01Command
$ curl -s -o NUL -w "%{http_code}" https://example.com02What it does
curl downloads the page, -o NUL throws the content away, and -w "%{http_code}" prints only the numeric status code: 200 OK, 301 redirect, 404 not found, 5xx server error. To see the full headers instead, run curl -I https://example.com. It's the fastest built-in way to check whether a site or API endpoint is alive.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- curl.exe - Transfer data from or to a serverEvidence: Windows curl reference documenting --head / -I (headers only) and write-out options; headers-only requests show the HTTP status line such as HTTP/1.1 200 OK.
- curl man pageEvidence: Documents -w/--write-out with variables such as %{http_code} (the HTTP response code) and -s/--silent for quiet mode; -o writes the body to a file (NUL discards it).
Last verified: 2026-09-19 · Category: Network
06Related solutions
Purge cached DNS lookups so Windows re-resolves hostnames from scratch — the fix for 'the new server is live but my browser still hits the old one'.
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.
Display the IP-to-MAC address cache Windows built by talking to neighbors — a quick way to spot which devices are on your subnet.