← All text tools

CORS Headers Generator

Generate Access-Control-Allow headers and ready server config for Nginx, Apache and Express from your origins, methods, headers and credentials setting.

  • Free
  • No sign-up
  • Works on any device

About CORS Headers Generator

CORS lets a page on one origin read responses from another. This tool takes your allowed origins, methods, request headers, exposed headers, cache time and credentials choice and writes the Access-Control headers plus config for Nginx, Apache and Express. It follows the Fetch Standard: only one origin or a wildcard may appear in Access-Control-Allow-Origin, so several origins get a map or environment rule and a Vary: Origin header. It blocks the invalid wildcard with credentials combination and gives a curl command to test the preflight.

How to use CORS Headers Generator

  1. List the exact origins that may call your API, one per line.
  2. Choose methods and headers, and tick credentials only if cookies are needed.
  3. Copy the config for your server and test the preflight with the curl command.

Why use this tool?

Also known as

Frequently asked questions

Why is a wildcard with credentials rejected?

Browsers refuse a response that allows every origin and also lets cookies through, because any site could then read private data. You must name the origin instead.

What is a preflight request?

It is an OPTIONS request the browser sends first for non-simple requests, asking which methods and headers are allowed. The server must answer with a 2xx status and the Allow headers.

Is CORS a security feature for my server?

No. It only tells browsers what pages may read. Anyone can call your API directly with curl, so you still need authentication and checks on the server.

Is CORS Headers Generator free?

Yes. CORS Headers Generator on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put CORS Headers Generator on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools