CORS Helper
Reference the CORS request and response headers and build guidance response headers for an origin, method and credentials mode.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Built 5 guidance response header(s) for a credentialed POST from https://app.example.com.
How it works
- Listed the CORS request, preflight and response headers with their meaning.
- Chose to echo the exact origin because credentialed requests cannot use the wildcard.
- Included the method, headers, credentials and max-age guidance.
- This is a reference and a header builder only; it never sends a request or checks a live server.
- A server must actually send these headers for the browser to expose the response.
Methodology
- List the CORS request, preflight and response headers with their direction and meaning.
- For the supplied origin and credentials mode, choose between echoing the origin and the wildcard per the Fetch rule.
- Build guidance Access-Control-Allow-Origin, -Methods, -Headers, -Credentials and -Max-Age values.
- State the preflight and credentials constraints that apply to the chosen mode.
Usage
- Enter the request origin (or leave it empty to see the wildcard behaviour).
- Choose the request method and whether credentials are included.
- Read the header reference and the generated response-header guidance.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
Credentialed request from an app origin
{
"origin": "https://app.example.com",
"method": "POST",
"credentials": true
}Credential-less public API
{
"origin": "https://app.example.com",
"method": "GET",
"credentials": false
}Limitations
The same-origin policy and CORS
Browsers block a page from reading a cross-origin response by default. CORS is the server's opt-in: it names the origins, methods and headers a browser may expose. The server controls this entirely; a page cannot grant itself access. That is why the fix for a CORS error is a server response header, never a client setting.
Simple requests and preflight
A simple request is sent directly and the response is blocked afterwards if CORS is missing. Anything else triggers a preflight OPTIONS request first, and the browser only sends the real request when the preflight allows it. This distinction explains why an error sometimes appears before any request method reaches your logs.
Frequently asked questions
- Why can't I use Access-Control-Allow-Origin: * with credentials?
- The Fetch standard forbids it: with credentials, the server must echo the exact origin so one response cannot be reused across origins. The generator reflects that by emitting the origin when credentials are enabled.
- When does the browser send a preflight?
- When the request is not a CORS simple request: a method other than GET, HEAD or POST, or a header that is not CORS-safelisted. The browser then sends an OPTIONS request first and needs the allow headers before the real request.
- Does a blocked CORS response mean the request failed?
- Not necessarily. CORS is enforced by the browser, so the server may have received and processed the request even though the page cannot read the response.
Sources
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.