Home › Developer Tools › CORS Tester

CORS Tester

Send a real cross-origin request from your browser to any URL, with your own method, headers, body and credentials mode, and find out whether CORS allows it. When it fails, follow-up probes tell you whether the cause is the preflight, credentials, a missing Access-Control-Allow-Origin header or the network.

Last updated:

Try:

Request analysis

    Origin sent by your browser:

    Inspect and fix on the server

    Browsers hide CORS headers from scripts. Run this with curl to see exactly what the server returns:

    
        

    The server must answer with headers like these (adjust to your needs):

    
      
    Advertisement
    Advertisement

    How to use the CORS Tester

    1. Enter the API URL and pick the HTTP method.
    2. Add headers and a body the way your front end sends them, for example Authorization or Content-Type: application/json.
    3. Choose the credentials mode: include sends cookies, which needs stricter server headers.
    4. Check the request analysis to see whether the browser will send a preflight, then click Send Request.
    5. Read the verdict, then copy the curl command and the required headers to fix the server.

    CORS response headers explained

    HeaderSent onPurpose
    Access-Control-Allow-OriginEvery responseThe origin allowed to read the response, or * for any origin (not with credentials)
    Access-Control-Allow-MethodsPreflightMethods allowed for the actual request, such as GET, POST, PUT, DELETE
    Access-Control-Allow-HeadersPreflightRequest headers the page may send, such as authorization, content-type
    Access-Control-Allow-CredentialsBothtrue lets requests with cookies or HTTP auth read the response
    Access-Control-Expose-HeadersActual responseExtra response headers scripts may read, such as x-total-count
    Access-Control-Max-AgePreflightSeconds the browser may cache the preflight result (browsers cap it, Chrome at 2 hours)
    Vary: OriginEvery responseStops caches from serving one origin's CORS answer to another origin

    Common CORS errors and their fixes

    • No 'Access-Control-Allow-Origin' header is present: the server does not send CORS headers at all, or only on success responses. Add the header to every response, including 4xx and 5xx errors.
    • Response to preflight request doesn't pass access control check: the OPTIONS request returns 401, 404 or 405. Handle OPTIONS before authentication and routing and return 204 with the Allow headers.
    • Request header field authorization is not allowed: add the header name to Access-Control-Allow-Headers.
    • The value of the header must not be the wildcard '*' when credentials mode is 'include': echo the request's Origin (from an allow list) and add Access-Control-Allow-Credentials: true.
    • Redirect is not allowed for a preflight request: the URL redirects (for example http to https or a missing trailing slash). Call the final URL directly.

    Example for nginx: add_header Access-Control-Allow-Origin $http_origin always; combined with an allow-list map, and if ($request_method = OPTIONS) { return 204; }. In Express, the cors middleware with { origin: ['https://app.example.com'], credentials: true } handles both preflight and actual responses.

    Frequently asked questions

    What is CORS?

    Cross-Origin Resource Sharing is the browser rule that decides whether JavaScript on one origin (scheme, host and port) may read a response from another origin. The server opts in by sending headers such as Access-Control-Allow-Origin. Without them the browser still sends many requests but hides the response from the page.

    What is a preflight request?

    Before a non-simple request, the browser sends an OPTIONS request with Access-Control-Request-Method and Access-Control-Request-Headers to ask permission. A request is simple only if it uses GET, HEAD or POST, has only safelisted headers such as Accept, and a Content-Type of text/plain, multipart/form-data or application/x-www-form-urlencoded. Sending JSON or an Authorization header always triggers a preflight.

    Why can't the tool show the Access-Control-Allow-Origin header?

    Browsers do not let scripts read most response headers, including the CORS headers, and on a CORS failure they give no detail at all. That is why the tool runs extra probes to narrow down the cause and gives you a curl command that shows the raw headers the server returns.

    Why does my request work in Postman or curl but not in the browser?

    CORS is enforced only by browsers. Postman, curl and server-side code ignore it, so a missing Access-Control-Allow-Origin header only shows up in front-end code. Fix it on the API server or route the call through your own back end.

    Can I use Access-Control-Allow-Origin: * with cookies?

    No. When the request uses credentials (cookies or HTTP authentication), the server must echo the exact origin and send Access-Control-Allow-Credentials: true. A wildcard origin is rejected by the browser in that case. Also add Vary: Origin so caches keep responses per origin.

    Which origin does this test use?

    The request is sent from this page, so the Origin header is freetoolcabin.com. If your API only allows your own site's origin, the test will show blocked even though your site works. Use the curl command with your real origin to confirm.

    Is my request sent through FreeToolCabin?

    No. The request goes straight from your browser to the URL you enter. There is no proxy, and nothing is stored. Avoid pasting production secrets into headers on shared computers.

    Are all the tools on FreeToolCabin tested for quality and accuracy?

    Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

    Related tools

    HTTP Status CodesSearch every HTTP status code with plain-English meanings, causes, fixes and RFC references.cURL to Code ConverterConvert curl commands to JavaScript fetch, Axios, Python requests, Node.js, PHP and Go code.URL ParserBreak a URL into its parts and edit query string parameters with a live rebuild.JWT DecoderDecode JSON Web Tokens, read the claims and expiry, and verify HS256 signatures.M3U8 PlayerPlay HLS .m3u8 streams in your browser, switch quality and inspect bitrate, segments and codecs.Email ValidatorCheck email lists and spot disposable addresses.Website Down CheckerCheck if a website is down for everyone.Deep Link GeneratorCreate links that open directly in apps.User Agent ParserSee your user agent and parse any UA string into browser, OS, engine and device.Subnet CalculatorCalculate IPv4 network, broadcast, host range, masks and host count, and split subnets.Bulk URL OpenerOpen a list of URLs in new tabs at once or in batches, with cleanup, dedupe and delay.DNS LookupLook up A, AAAA, MX, TXT, NS, CNAME, SOA and CAA records with TTLs over secure DNS.API Request TesterSend GET, POST, PUT and DELETE requests with headers and a body, then inspect the response.WebSocket TesterConnect to a ws:// or wss:// server, send messages and watch a timestamped live log.WHOIS LookupLook up who registered a domain or IP: registrar, creation and expiry dates, name servers, status.Mailto Link GeneratorBuild encoded mailto: links with cc, bcc, subject and body, plus HTML code and a QR code.WhatsApp Link GeneratorCreate wa.me click-to-chat links with a pre-filled message, button HTML and a QR code.Basic Auth Header GeneratorCreate an Authorization: Basic header from a username and password, or decode one.Common Ports ListSearchable TCP/UDP port number list with service, protocol and description, filterable by range.DMARC CheckerLook up a domain's DMARC record, explain every tag, grade the policy and get fix suggestions.DMARC Record GeneratorCreate a DMARC TXT record with policy, reporting and alignment options, every tag explained.Email Header AnalyzerPaste raw email headers to trace every server hop, see delays and check SPF, DKIM and DMARC.IP Geolocation LookupFind the country, city, ISP, ASN and time zone of any IP address or domain, with a map.Reverse DNS LookupFind the PTR hostname of any IPv4 or IPv6 address, one at a time or hundreds in bulk.SPF Record CheckerLook up a domain's SPF record, count nested DNS lookups, find errors and test a sender IP.SPF Record GeneratorBuild a valid SPF TXT record from mail providers, IPs and includes, with a lookup-count check.CIDR to IP RangeConvert IPv4 or IPv6 CIDR blocks to first/last IP, mask and host count, and export IP lists.DNS Propagation CheckerCompare DNS answers and TTLs from Cloudflare, Google, Quad9, AdGuard and NextDNS side by side.Domain Availability CheckerCheck if domain names are available across .com, .io, .ai and more, with registrar and expiry.MAC Address LookupFind the vendor of a MAC address or OUI, check multicast and random bits, look up many at once.MX LookupFind a domain's mail servers: MX priority, host, IP addresses and the email provider.Uptime SLA CalculatorTurn 99.9% uptime into allowed downtime per day, month and year, or downtime into uptime %.Website Speed TestTest page speed with Lighthouse: performance score, Core Web Vitals and fixes, mobile or desktop.ASN LookupLook up an AS number or IP: network owner, country, registry, abuse contact and announced prefixes.Bandwidth CalculatorEstimate monthly website bandwidth (GB) and the Mbps you need from page views and page size.CNAME LookupFollow a hostname's full CNAME chain to its final IP addresses, with TTLs and CDN detection.DKIM Record CheckerLook up a domain's DKIM key by selector (or auto-detect), check key type, bit length and tags.DKIM Record GeneratorCreate a DKIM RSA key pair in your browser with the TXT record, selector host and private key PEM.Email Deliverability CheckerGrade a domain's MX, SPF, DMARC, DKIM, BIMI and MTA-STS records in one report with fixes.Email ObfuscatorHide an email address from spam bots with HTML entities, a JavaScript mailto link or reversed CSS text.Email PermutatorGenerate every common business email format from a first name, last name and company domain.HTTP Header ParserPaste raw HTTP headers to get a table explaining each one plus a security headers grade.IP Blacklist CheckerCheck an IPv4 address against 21 public spam blocklists (DNSBLs) and see listed or clean.IP Range to CIDRTurn a start and end IP into the shortest list of CIDR blocks, for IPv4 and IPv6.IPv6 Subnet CalculatorIPv6 prefix to network, range, address count and /64s, and split it into child subnets.Link in Bio Page GeneratorCreate a link-in-bio page with avatar, bio, links and theme, then download it as one HTML file.NS LookupFind a domain's authoritative nameservers with their IPs, SOA record and DNS hosting provider.Social Share Link GeneratorMake share links and buttons for Facebook, X, LinkedIn, Reddit, Pinterest, WhatsApp and email.Subnet Mask Cheat SheetInteractive /0 to /32 table of subnet masks, wildcards and host counts with details per prefix.TXT Record LookupLook up a domain’s DNS TXT records and see which are SPF, DMARC, DKIM or verification tokens.VLSM CalculatorSplit a network into variable-length subnets sized to the hosts each one needs.YouTube Timestamp Link GeneratorMake YouTube links that start at a set time, embed start/end codes and lists of timestamps.DMARC Report AnalyzerRead DMARC aggregate XML reports (.xml, .gz, .zip): sources, SPF/DKIM alignment and pass rates.Domain Age CheckerSee how old a domain is, when it was registered and when it expires. Bulk check up to 50.
    See all 52 Network, DNS & Email Tools →