CORS Header Analyzer
Paste HTTP response headers from any API and instantly decode the CORS policy. See which origins and methods are allowed, whether credentials are permitted, and what preflight requirements apply — with plain-English explanations for each header.
Frequently Asked Questions
What CORS headers should I look for in an API response?▼
The key headers are: Access-Control-Allow-Origin (which origins can read the response), Access-Control-Allow-Methods (which HTTP methods are permitted), Access-Control-Allow-Headers (which request headers are allowed), Access-Control-Allow-Credentials (whether cookies/auth are permitted), and Access-Control-Max-Age (how long preflight results can be cached). Paste your response headers here and this tool shows what each one means and whether your request would be allowed.
What does Access-Control-Allow-Origin: * mean?▼
Wildcard (*) means any origin can read the response. This is appropriate for public APIs (CDN assets, open data APIs) but dangerous for APIs that return user-specific data. Crucially, * cannot be combined with Access-Control-Allow-Credentials: true — the browser will block the request with a CORS error. For credentialed requests, the server must echo back the specific requesting origin.
Why do I get a CORS error even though the header is present?▼
Several gotchas: (1) The header value doesn't match your origin exactly — scheme, host, and port must all match. (2) You're using credentials (cookies, Authorization header) with a wildcard origin. (3) The server is only sending CORS headers for OPTIONS preflight, not for the actual request. (4) Your server framework strips headers on error responses. (5) A CDN or proxy is stripping CORS headers before they reach the browser.
What is an OPTIONS preflight request?▼
For 'non-simple' cross-origin requests — those using methods other than GET/POST/HEAD, or custom headers like Authorization or Content-Type: application/json — browsers first send an HTTP OPTIONS request to ask the server what it permits. The server must respond with Access-Control-Allow-Methods and Access-Control-Allow-Headers. If the preflight fails or is missing required headers, the actual request is never sent.
How does Access-Control-Max-Age reduce latency?▼
Access-Control-Max-Age tells the browser how many seconds to cache the preflight result. Without it (or with a low value), the browser sends an OPTIONS preflight before every cross-origin request. With a high value (e.g., 86400 = 1 day), the browser skips the preflight for subsequent requests to the same endpoint. This eliminates the round-trip latency of the OPTIONS request for repeat callers.
What does Access-Control-Expose-Headers do?▼
By default, JavaScript can only read a small set of 'safe' response headers (like Content-Type and Cache-Control). Access-Control-Expose-Headers explicitly whitelists additional headers for JavaScript access. This is commonly needed for pagination (Link header), rate limiting (X-Rate-Limit-Remaining), request tracing (X-Request-Id), and API versioning headers. Without it, response.headers.get('x-request-id') returns null even if the header is present.
Related Products
on GumroadDevToolkit Starter Kit
A ready-to-deploy developer tools website with 12 built-in tools. Astro + Preact + Tailwind. Deploy to Cloudflare Pages for free. Built-in SEO, dark mode, and ad-ready layout.
Buy on Gumroad →TypeScript Quick Reference Toolkit
5 practical reference files for TypeScript developers: cheatsheet, TS vs JS comparison, 20 utility types with real examples, tsconfig best practices template, and 15 common mistakes guide. Print it. Keep it on your desk.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
CORS Policy Builder
Generate CORS configuration for Express.js, Nginx, FastAPI, Django, Koa, Laravel, and Spring Boot. Set allowed origins, methods, headers, credentials, and max-age.
Open free tool →
OpenAPI Validator
Paste your OpenAPI 3.x spec (YAML or JSON) to validate structure, find missing required fields, detect duplicate paths, check for missing operationIds, and get errors and warnings with path references.
Open free tool →
HTTP Status Code Reference
Complete HTTP status code reference. Search all 1xx, 2xx, 3xx, 4xx, and 5xx codes with plain-English descriptions, real-world use cases, and when to use each in REST APIs.
Open free tool →
More Free Tools
Related Articles
Base64 Encode/Decode Explained: When and How to Use It
Understand when to use Base64 encoding and when to avoid it. This guide explains the Base64 algorithm, practical use cases, code examples in JavaScript, Python, Go, and more.
JWT Token Decoder: How to Debug Authentication Issues
Learn how to use a JWT token decoder to diagnose 401 errors, expired tokens, missing claims, and auth misconfiguration. Practical debugging guide with code examples.
Base64 Decode Online: Instantly Decode Any Base64 String for Free
Decode Base64 strings instantly online — JWT payloads, API image data, env vars, and SSH keys. No install needed, no account. URL-safe variant supported.
Base64 Encoding and Decoding Explained for Developers
Understand Base64 encoding and decoding from the ground up. Learn when to use it, how it works, common pitfalls, and how to encode/decode instantly online.
CORS Tester Online: Debug Cross-Origin Errors Without Guessing
Use a CORS tester to diagnose cross-origin resource sharing errors instantly. Understand preflight requests, CORS headers, and how to fix 'No Access-Control-Allow-Origin' errors.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →