CORS Header Builder and Explainer

Explain CORS scenarios and download bounded Nginx, Apache or Express drafts.

On-device No sign-up Free to use

Build CORS headers controls

?

One HTTP(S) origin, or * for non-credentialed sharing.

?

Explicit uppercase methods, separated by commas.

?

Explicit names, separated by commas; blank for none.

?

Supply the preflight header names, not their values. This model does not infer whether a real request needs preflight.

Processed in your browser. Your inputs stay on this device.

Showing an example. Change the fields, then use build cors headers to update it.

Result

Showing an example.

Compare a credentialed POST from https://client.example that requests the content-type header.

Supplied preflight settings match this entered policy.

Loading the tool. Your result will appear here.

https://usefreetools.net/cors-header-builder-explainer · 20 November 2026

Was this helpful?

How to use CORS Header Builder and Explainer

  1. Enter one allowed HTTP(S) origin, or * for a non-credentialed response. Choose credentials, allowed methods and non-safelisted request-header names.
  2. Supply the request origin, preflight method and header names you want to compare. Enter header names rather than their values.
  3. Build the headers and read each comparison row. The result compares entered settings; it does not send the request.
  4. Copy the header list or download the Nginx, Apache and Express drafts. Adapt them to the intended route, handle the real OPTIONS response and test the request and response in your application.

Example: CORS Header Builder and Explainer

Compare a credentialed POST from https://client.example that requests the content-type header.

You add
Allowed origin: https://client.example; Share a response to a credentialed request: true; Allowed methods: GET, POST; Allowed non-safelisted request headers: content-type; Supplied request origin: https://client.example; Supplied preflight method: POST; Supplied non-safelisted header names: content-type
You get
Supplied preflight settings match this entered policy.

Options

Allowed origin
One HTTP(S) origin, or * for non-credentialed sharing.
Share a response to a credentialed request
Adds Access-Control-Allow-Credentials: true to the draft. Use an explicit allowed origin; the wildcard origin is refused for credentialed sharing.
Allowed methods
Explicit uppercase methods, separated by commas.
Allowed non-safelisted request headers
Explicit names, separated by commas; blank for none.
Supplied request origin
The initial value is https://client.example.
Supplied preflight method
The initial value is POST.
Supplied non-safelisted header names
Supply the preflight header names, not their values. This model does not infer whether a real request needs preflight.

Supported inputs and limits

  • Local teaching model; no live request, server configuration change, origin authorization decision or security certification.
  • One explicit HTTP(S) origin or non-credentialed wildcard.
  • Credentialed wildcard origins are refused.
  • Other browser/server restrictions can still block a request.
  • At most 30 explicit methods and header names;
More details

Fetch-forbidden CONNECT, TRACE and TRACK are refused.

Supply non-safelisted preflight header names explicitly: the tool does not infer them from values.

Configuration snippets are escaped generated text.

Review credentials, origins and preflight behavior in your application before applying them; no server is changed.

Where your input is processed

This tool does not upload your inputs. See the limits for anything saved on your device.

CORS governs browser access to a response

These headers are not authentication or a network firewall. A permitted origin is a rule for browser response sharing, not evidence that a requester is trustworthy. Use an exact origin when modelling credentialed access; a wildcard origin cannot represent that credentialed case. Apply any policy only in the server context where it belongs.

A supplied preflight is not a captured request

The model compares the supplied origin, method and non-safelisted header names. It does not decide whether the real request needs preflight, contact a server or inspect deployed middleware. The downloaded snippets set response headers; they do not implement a complete route or OPTIONS handler. Test the actual request and response after adapting a draft.

Questions about CORS Header Builder and Explainer

Does CORS authenticate a visitor?

No. It controls whether a browser exposes a cross-origin response. Authentication and authorization are separate server responsibilities.

Why is a wildcard refused with credentials?

Credentialed sharing requires an explicit origin. A wildcard Access-Control-Allow-Origin cannot authorize that browser response.

Does a passing simulation prove my server works?

No. It compares entered settings only. Your real response, browser state, redirects and network behavior remain untested.

Page updated · Project managed by Tony Hines · Report a problem with CORS Header Builder and Explainer