CaptchaNo
Back to blog
deep-dives16 Oct 2026·11 min read

What Is Cloudflare Turnstile and How Does It Work?

DDishant Singh
deep-dives

Cloudflare Turnstile is a free CAPTCHA alternative that checks the browser, not the user. How it works, its 3 modes, token rules, limits and errors.

Cloudflare Turnstile is Cloudflare's free CAPTCHA alternative. It checks the browser instead of asking the visitor to pick out traffic lights. A small widget runs background JavaScript challenges, sometimes shows a single "Verify you are human" checkbox, and hands your form a token. Your server then confirms that token with Cloudflare. If you want to watch one run, our live Turnstile and reCAPTCHA test page loads a real widget with a real sitekey.

We run CaptchaNo, a captcha-solving API, so we deal with Turnstile from both sides: as a widget on our own pages and as a challenge our customers' automation meets. Everything below comes from Cloudflare's current documentation (read on 30 November 2026) or from what we recorded on our own demo page, with the raw numbers shown.

What is Cloudflare Turnstile?

Turnstile is a bot check you embed in a page, much like reCAPTCHA, but it doesn't use image puzzles. Cloudflare launched it in September 2022 as a privacy-focused replacement for CAPTCHAs.

Three points cause most of the confusion around it:

  • You don't need Cloudflare's CDN. Per Cloudflare's Turnstile overview, any site can embed it without routing its traffic through Cloudflare.
  • It shares an engine with Cloudflare's challenge pages. Both run on the same Challenge Platform. That's why the widget and the full-page "Verify you are human" screen look alike, even though they're different products (more on that below).
  • It's still a captcha in practice. Most visitors never click anything, but your server only accepts a request that carries a valid token. For a script, that means it needs a token like any other captcha.

How does Cloudflare Turnstile work?

Turnstile runs a set of small, non-interactive JavaScript challenges in the browser, decides whether that's enough, and issues a one-time token for your server to verify. Step by step:

  1. The script loads. Your page includes api.js from challenges.cloudflare.com, and the widget renders in an iframe from that host.
  2. Background challenges run. Cloudflare lists proof-of-work (computational puzzles), proof-of-space, probing for web APIs, and checks for browser quirks and human behaviour. It tunes the difficulty to each request.
  3. Managed mode may ask for a click. If the signals aren't enough, the widget shows one checkbox. There are no images and no text to read.
  4. A token is issued. The widget writes it to a hidden input called cf-turnstile-response, which is submitted with the form, and it also passes the token to any callback you registered.
  5. Your server verifies it. The backend posts the token and your secret key to Cloudflare's siteverify endpoint and acts on success. Without this step the widget protects nothing.

What we saw when we loaded a real Turnstile widget

On 29 November 2026 (19:00 UTC) we loaded our own demo page, which uses a real Managed-mode sitekey, four times in Playwright's Chromium 151: twice headless and twice in a visible window. We didn't click anything. In all 4 runs the widget switched to the "Verify you are human" checkbox, and none of the runs got a token within 60 seconds. That matches Cloudflare's own warning that automated test suites such as Selenium, Cypress and Playwright are detected as bots.

Cloudflare Turnstile Managed widget showing the Verify you are human checkbox on the CaptchaNo demo login form

The Managed widget on our demo, as automated Chromium saw it in all 4 runs (29 Nov 2026).

A fifth headless load logged every response from Cloudflare's challenge hosts in 30 seconds:

Time after loadRequest (path shortened)Status
210 ms/turnstile/v0/api.js302 to a versioned api.js
229 ms/turnstile/v0/g/…/api.js200
320 ms…/turnstile/f/av0/rch/…/auto/…/new/normal (widget iframe)200
621 ms…/h/g/fo/…200
1,379 ms…/h/g/pat/… (Private Access Token)401
2,621 ms…/h/g/ci/…200
2,730 ms…/h/g/fo/…200

Two details are useful when you're debugging. First, the 401 on the pat request is expected. Cloudflare's docs say browsers and devices that can't issue a Private Access Token get a 401, and the widget falls back to its normal checks. Second, the four earlier runs also called brunhild.challenges.cloudflare.com, a subdomain Cloudflare added to its required allowlist in July 2026. If a firewall or Content Security Policy blocks it, the widget fails. For the full request map of that host, see what challenges.cloudflare.com is and why your browser calls it.

The three Turnstile widget modes

Every widget has one of three modes. All three return the same token, so your server-side code doesn't change between them.

ModeWhat the visitor seesCan it ask for a click?Good fit
Managed (recommended)A widget that usually just shows a spinnerYes, one checkbox when risk is higherLogins, sign-ups, most forms
Non-interactiveA widget with a loading spinnerNoLow-friction forms where you still want visible proof of a check
InvisibleNothingNoCheckout or search, where any widget gets in the way

One condition is easy to miss: if you use Invisible mode, Cloudflare requires your privacy policy to reference its Turnstile Privacy Addendum. Some ranking guides list an "Interactive" mode or describe Managed as invisible. Neither matches Cloudflare's own table:

Cloudflare documentation table listing the Managed, Non-Interactive and Invisible Turnstile widget modes

Widget modes in Cloudflare's Turnstile docs, captured 30 Nov 2026.

The Turnstile token and what your server checks

A Turnstile token is a single-use string that lasts 300 seconds. It only means something once your server has confirmed it with siteverify. The rules from Cloudflare's server-side validation guide:

  • Lifetime: 300 seconds from generation. Sites can't make it longer, and a late submit fails with timeout-or-duplicate.
  • Size: up to 2,048 characters.
  • Single use, eventually: reuse detection takes time to spread across Cloudflare's network. The stated target is to reject at least 99% of repeat validations that arrive five seconds or more after the first success. Two validations sent close together can both pass. If you rely on single use for something like a payment step, record redeemed tokens yourself.
  • Request fields: secret and response are required. remoteip (the visitor's IP) and idempotency_key (for safe retries) are optional.
  • Response fields: success, challenge_ts, hostname, error-codes, plus the action and cdata you set on the widget. Compare hostname and action against what you expect, not just success.

Is the token tied to an IP address or a browser? Only partly. IP checking is optional: it happens when the site sends remoteip. Cloudflare's mobile guidance says that changing the user agent during a session makes challenges fail. So the practical rule for automation is to submit from the same IP and user agent that produced the token. The general version of that problem is in why a valid captcha token still gets rejected.

Is Cloudflare Turnstile free?

Yes. Cloudflare's Free plan includes all three widget modes and unlimited challenges, and you don't need any other Cloudflare service. The limits are on setup, not traffic: up to 20 widgets per account and 10 hostnames per widget. Enterprise adds unlimited widgets, up to 200 hostnames per widget, "any hostname" widgets, Ephemeral IDs (a device ID returned by siteverify) and Offlabel (no Cloudflare branding).

Cloudflare Turnstile plans table comparing Free and Enterprise widget, hostname and analytics limits

Turnstile Free vs Enterprise, from Cloudflare's plans page, captured 30 Nov 2026.

Turnstile widget vs Cloudflare challenge page vs pre-clearance

These are three different things, and most wrong advice online mixes them up. The widget gives you a token that your server verifies. A challenge page is Cloudflare blocking the whole page before your site loads. Pre-clearance is an opt-in bridge between the two.

Turnstile widgetChallenge page (interstitial)Turnstile with pre-clearance
Who adds itThe site, in its own HTMLCloudflare's WAF or bot rules, on proxied sitesThe site, on a widget whose hostname is proxied by Cloudflare
Needs Cloudflare's proxyNoYesYes
What a pass producescf-turnstile-response tokencf_clearance cookieToken plus a cf_clearance cookie
Who checks itYour server, via siteverifyCloudflare's edgeBoth
Typical fix when stuckToken, hostname or CSP problemIP reputation, browser or WAF ruleEither of the two

If what you're looking at is a full page saying "Verify you are human" that keeps reloading, you're dealing with the challenge page, not a form widget. The visitor-side fixes are in why Cloudflare keeps asking you to verify you are human.

How to add Turnstile to your website

Adding Turnstile takes four steps: create a widget, load the script, place the widget, and verify the token on your server.

  1. In the Cloudflare dashboard, add a Turnstile widget. Name it, list your hostnames, pick a mode, then copy the sitekey (public) and secret key (private).
  2. Load https://challenges.cloudflare.com/turnstile/v0/api.js with async defer.
  3. Put <div class="cf-turnstile" data-sitekey="YOUR_SITEKEY"></div> inside your form, or render it from JavaScript with turnstile.render() if you need control over when it appears.
  4. On submit, POST secret, response and optionally remoteip to https://challenges.cloudflare.com/turnstile/v0/siteverify. Reject the request unless success is true and hostname matches your site.

For CI and local development, use Cloudflare's dummy sitekeys and secrets instead of a real widget, so your tests aren't flagged as bots. We've recorded the exact responses each test key returns in how to test reCAPTCHA and Turnstile with test keys. If you're still choosing a widget, our Turnstile vs reCAPTCHA comparison for site owners covers the trade-offs.

Why Turnstile fails for real visitors

When a real person gets stuck, the widget shows a numeric error code, and the first digits tell you whose problem it is:

  • 110100, 110110, 400020: invalid or unknown sitekey. This is a site configuration bug.
  • 110200: the domain isn't in the widget's hostname list. Add it under Hostname Management.
  • 200100: the visitor's clock is wrong, or a cache served a stale challenge.
  • 200500: the iframe couldn't load. Usually a blocked challenges.cloudflare.com, a CSP rule or an aggressive extension.
  • 300xxx and 600xxx: generic challenge failure, meaning Cloudflare saw bot-like behaviour. Cloudflare suggests an up-to-date browser, no extensions, no VPN, or a different network.

The 600xxx family is the most common one, and we've broken it down with real browser runs in Cloudflare error 600010: what it means and how to fix it.

Turnstile in automation, and where CaptchaNo fits

Our demo runs show what to expect: an automated browser on a Managed widget usually meets the checkbox and gets no token on its own. You have three honest options, depending on whose site it is.

  • It's your site: use the dummy keys in test environments, or add a test-only bypass in your own backend. Don't solve your own captcha in CI.
  • You're automating a workflow you're allowed to run (your own accounts, QA on a client's site, data you have the right to collect): get a token from a solver and submit it the way a browser would.
  • It's a challenge page, not a widget: it needs the extra values the page passes to the widget (action, cData and page data), or a real browser session that clears it.

Our Cloudflare Turnstile solver covers Managed, Non-interactive and Invisible widgets. It accepts action and cData, handles challenge-page parameters, mints the token behind the proxy you supply, and returns the user agent it used so you can submit with the same one. Solves run on our own solving infrastructure, and you're only billed for successful solves. For working code, see the Python Turnstile walkthrough with Playwright or the Node.js version in solving Turnstile in Playwright for Node. Questions about a specific site go straight to the engineers who run the service at support@captchano.com.

Frequently Asked Questions

Is Cloudflare Turnstile a CAPTCHA?

It is a CAPTCHA replacement that still works like one. Instead of image puzzles it runs background browser checks and, in Managed mode, sometimes a single checkbox. But the site only accepts a request that carries a valid token, so for scripts and bots it is a gate in the same way a reCAPTCHA is, just one that most humans pass without noticing.

Do I need to use Cloudflare's CDN to use Turnstile?

No. The widget works on any website, whether or not its traffic goes through Cloudflare, and the Free plan does not require any other Cloudflare product. You only need the proxy for the optional pre-clearance feature, which issues a cf_clearance cookie, and for Cloudflare's own challenge pages, which are a separate WAF and bot-management feature rather than part of the embedded widget.

How long is a Turnstile token valid?

Each token is valid for 300 seconds from the moment it is generated and is meant to be validated once. After five minutes, or after it has already been redeemed, siteverify returns the timeout-or-duplicate error code. Sites cannot extend that window, so request or refresh the token right before submitting rather than at the start of a long form or workflow.

Why does Turnstile keep failing or looping for me?

Repeated failures usually come from the browser environment rather than from you. Outdated browsers, privacy or ad-blocking extensions, VPNs, a wrong system clock and networks with poor reputation all trigger the generic 300 and 600 error families. Update the browser, try a private window without extensions, switch off the VPN or change networks, and the widget normally passes on the next attempt.

Is Cloudflare Turnstile better than reCAPTCHA?

It depends on what you value. Turnstile shows visitors fewer puzzles, is free with unlimited challenges, and is not tied to Google services. reCAPTCHA v3 gives you a risk score you can tune, and reCAPTCHA Enterprise adds deeper fraud tooling. For a typical login or contact form, Turnstile is the lower-friction default; for score-based risk decisions, reCAPTCHA offers more control.

Handle Turnstile in your own stack

Send the sitekey and page URL, get a cf-turnstile-response token plus the user agent to submit with, and pay only when the solve succeeds. Check the per-solve rates on our pricing page and point your first request at a real Turnstile form.