Skip to content

Menu

CORS Tester

Simulate CORS preflight and check headers

Runs entirely in your browserAPI & HTTPFree, no sign-up
Loading tool

01What is CORS Tester?

CORS errors are some of the most confusing messages a browser shows you. The request often reached the server just fine, yet your JavaScript never sees the response. This tester lets you work out why without deploying anything. It simulates how a server's CORS configuration would answer a request from a given origin. You enter the Request Origin and the server's Allowed Origin(s), which can be a single origin, a comma-separated list or *. Then you set the methods, headers, credentials flag, max-age and exposed headers. The badge flips between CORS Allowed and CORS Blocked depending on whether the origin matches. The comparison is an exact string match, which is also how browsers compare the Origin header. Next to the badge, the tool builds the Access-Control-* response headers the server should send. A wildcard origin produces Access-Control-Allow-Origin: *. A listed origin is echoed back on its own, together with Vary: Origin so shared caches keep responses apart. The checks follow the CORS rules in the WHATWG Fetch standard, which is what browsers implement. Wildcard origin plus credentials is reported as an error and the badge shows Blocked, because browsers refuse credentialed responses with Allow-Origin: *. With credentials on, a * in Allow-Methods or Allow-Headers is not a wildcard at all, and you get a warning for each. Without credentials, a * in Allow-Headers still never covers Authorization. A max-age that isn't a whole number of seconds is listed as an error. Values over 7200 get a warning, because Chromium caps the preflight cache at two hours and Firefox at 24. Here's a quick example. Say the request origin is https://staging.example.com and the allowed list is https://app.example.com, https://staging.example.com. The badge shows Allowed, and the header block starts with Access-Control-Allow-Origin: https://staging.example.com followed by Vary: Origin. Copy Headers gives you the generated block as plain text, ready for an nginx, Express or gateway config. Now the honest limits. This is a simulator. It checks the origin and the configuration you typed, not your real server. It doesn't compare the method or headers a browser would ask for in Access-Control-Request-Method and Access-Control-Request-Headers. It also doesn't know about simple requests that skip the preflight entirely. To test a live endpoint, send an OPTIONS request with curl or watch the Network tab in DevTools. Everything runs in your browser, so nothing you type is sent anywhere.

Front-end and API developers use it to figure out why a browser blocks a cross-origin call and which Access-Control headers will fix it. The tool runs entirely in your browser, so your data never leaves your device.

02How to use CORS Tester

  1. Enter the browser's Request Origin, such as https://app.example.com.
  2. Fill in Allowed Origin(s) with a comma-separated list or *.
  3. Set Allow Methods, Allow Headers, Credentials, Max-Age (seconds) and Expose Headers.
  4. Check the CORS Allowed or CORS Blocked badge and read any errors or warnings below it.
  5. Click Copy Headers to take the Preflight Response Headers into your server config.

03Worked examples

Input: Origin https://app.example.com, allowed origins https://app.example.com, credentials false
Result: CORS Allowed. Headers: Access-Control-Allow-Origin: https://app.example.com, Vary: Origin, plus the methods and headers you entered.
When a specific origin is echoed back, Vary: Origin is added so caches don't serve one origin's response to another.
Input: Origin https://app.example.com/ (trailing slash), allowed origins https://app.example.com
Result: Blocked: Origin "https://app.example.com/" is not in the allowed origins list.
Origins are compared as exact strings, so a trailing slash or http vs https makes them different.
Input: Allowed origins *, Allow-Headers *, credentials false
Result: Allowed, with warning: The * wildcard in Access-Control-Allow-Headers never covers Authorization; list it explicitly if clients send it.
Without credentials, a * in Allow-Headers covers most headers, but the Fetch standard excludes Authorization.
Input: Origin https://app.example.com, allowed origins *, credentials true
Result: CORS Blocked: Cannot use wildcard (*) with credentials. Browsers block credentialed requests when Access-Control-Allow-Origin is *; echo the specific origin instead.
The classic cookie bug. Switch Allowed Origin(s) to the exact origin and the badge turns green.
Input: Allowed origins https://app.example.com, Allow-Methods *, Allow-Headers *, credentials true
Result: Allowed, with two warnings: with credentials, Allow-Methods * is treated as a method literally named "*", and Allow-Headers * is not a wildcard.
Input: Allowed origins *, Max-Age 86400
Result: Allowed, with warning: Chromium caps the preflight cache at 7200 s and will treat 86400 s as 7200 s.
The header is still emitted as 86400. A value like 1h is listed as an error because Max-Age must be a whole number of seconds.

04Common use cases

  • Working out why a React app on localhost:3000 gets blocked calling an Express or FastAPI backend
  • Drafting the Access-Control headers for an API Gateway, nginx or Cloudflare Worker config
  • Checking whether a staging subdomain is covered by a comma-separated allowlist before deploying
  • Explaining to a teammate why cookies fail with Access-Control-Allow-Origin: *
  • Confirming that a credentialed request (cookies or Authorization) won't work with a wildcard origin before you ship the config
  • Picking a sensible Access-Control-Max-Age so preflights are cached without going past Chromium's two-hour cap
  • Deciding which custom response headers, like X-Request-Id, need to go in Expose-Headers so front-end code can read them

05Tips

  • Origin matching is exact: scheme, host and port must all match, and a trailing slash breaks it.
  • If you list several origins, your server must echo only the matching one per request. The header can't hold a list.
  • Add Vary: Origin whenever the Allow-Origin value changes per request, or CDNs may cache the wrong response.
  • Custom response headers stay hidden from JavaScript unless they're named in Access-Control-Expose-Headers.
  • An invalid Max-Age shows up as an error, but the badge only reflects the origin and credentials check, so read the error list too.

06Related concepts

Cross-Origin Resource Sharing, Preflight request, Same-origin policy, HTTP headers, Credentialed requests.

Frequently Asked Questions

What is CORS Tester?

CORS Tester is a free, browser-based developer tool on AIDToolStack. Simulate CORS preflight and check headers It requires no installation or sign-up and works entirely in your browser.

Is CORS Tester free to use?

Yes. No sign-up, no fees and no usage cap.

Does CORS Tester store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe