Docs

Set up in three steps, without an account and without keys. To try it out, there is the live demo.

Add it with AI

Human Check is available as an MCP server. Connect it once and your AI assistant knows every template and adds Human Check by itself.

Claude Code

claude mcp add --transport http human-check https://placeforhumans.org/mcp

Claude on desktop or in the browser: Settings, Connectors, add a custom connector with the address https://placeforhumans.org/mcp. Other assistants use the same address as an MCP server (HTTP).

Then

Just say: “Add the Human Check gate” or “Protect the contact form with Human Check”. Claude Code has ready-made commands for this: /mcp__human-check__gate and /mcp__human-check__form.

Without MCP

Paste this request. The assistant then reads the guide at /en/human-check/llms.txt.

Add the Human Check gate to this project.
First read https://placeforhumans.org/en/human-check/llms.txt and follow the guide for our platform exactly.
Then tell me how to set HUMAN_CHECK_SECRET and how to test it.
Protect our contact form with Human Check.
First read https://placeforhumans.org/en/human-check/llms.txt and follow part A (widget in a form) exactly,
including verifying the token on our server.

1. Add the widget

Load the script and put <div class="human-check"> into the form. On submit, the widget checks the visitor and adds the field humancheck-token to the form.

<script src="https://placeforhumans.org/humancheck.js" defer></script>

<form action="/login" method="post">
  <input name="email"> <input name="password" type="password">
  <div class="human-check" data-use="login"></div>
  <button type="submit">Sign in</button>
</form>

data-use says what you are checking for (see below) and sets the recommendation. Optional: data-lang="en" or "de" (otherwise the widget follows the page's <html lang>), data-theme="light" or "dark" for fixed colors (otherwise it follows the visitor's device), data-callback="myFunction" for a function that receives the result after the check.

Text mode for comments, reviews and messages

With data-mode="text", Human Check also checks whether the text in the named field was typed by hand: rhythm, speed, corrections, pasting. Only the length of the text is sent to us, never its content. Without data-field, the widget takes the first textarea in the form.

<div class="human-check" data-mode="text" data-field="message"></div>

2. Verify on your server

Send the token to the verify endpoint, ideally with use: then your use case counts, not the one from the browser. The token is valid for 5 minutes and exactly once. Add lang: "en" for English texts. Always compare the hostname with your domain, otherwise someone could slip in a token from another site.

Node.js

const res = await fetch("https://placeforhumans.org/api/v1/verify", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ token: req.body["humancheck-token"], use: "login" }),
});
const check = await res.json();
if (!check.success || check.hostname !== "your-site.com") {
  return res.status(403).send("Invalid check.");
}

const { action, stepUp, hint } = check.recommendation;
if (action === "block") return res.status(403).send(hint);
if (action === "step-up") return sendEmailCode(); // stepUp says what fits
// "allow": continue as usual

PHP

$res = file_get_contents("https://placeforhumans.org/api/v1/verify", false,
  stream_context_create(["http" => [
    "method"  => "POST",
    "header"  => "Content-Type: application/x-www-form-urlencoded",
    "content" => http_build_query(["token" => $_POST["humancheck-token"] ?? "", "use" => "login"]),
  ]]));
$check = json_decode($res, true);

if (empty($check["success"]) || $check["hostname"] !== "your-site.com"
    || $check["recommendation"]["action"] === "block") {
  http_response_code(403);
  exit($check["recommendation"]["hint"] ?? "Invalid check.");
}

curl

curl -X POST https://placeforhumans.org/api/v1/verify \
  -d "token=THE_TOKEN_FROM_THE_FORM" -d "use=login"

3. The response

human is our recommendation from a human score of 70. You can also decide yourself with score (0–100). verdict sums it up: mensch (human), unsicher (unsure), bot or ausgeschlossen (excluded). layers shows the points of the five layers, and every finding in reasons has a fixed code for your own rules. confidence (hoch = high, mittel = medium, gering = low) and coverage say how many of the 100 points were measured rather than assumed: a login form yields little data, a typed text a lot. On errors you get success: false with token-missing, token-invalid, token-expired or token-used.

{
  "success": true,
  "human": true,
  "score": 95,
  "verdict": "mensch",
  "confidence": "hoch",
  "coverage": 100,
  "recommendation": {
    "use": "comment",
    "action": "allow",
    "reason": "Human score 95 (human, confidence high).",
    "stepUp": null,
    "hint": null
  },
  "hostname": "your-site.com",
  "checkedAt": "2026-11-21T12:30:00.000Z",
  "layers": { "input": 35, "browser": 20, "network": 20, "pow": 10, "extra": 10 },
  "reasons": [
    { "layer": "input", "code": "input.human", "text": "Interaction like a human", "points": 35, "good": true },
    { "layer": "browser", "code": "browser.clean", "text": "Real browser without anomalies", "points": 0, "good": true },
    { "layer": "network", "code": "network.residential", "text": "Home internet connection", "points": 0, "good": true },
    { "layer": "pow", "code": "pow.solved", "text": "Puzzle solved", "points": 0, "good": true },
    { "layer": "extra", "code": "extra.passed", "text": "Invisible extra check passed", "points": 0, "good": true }
  ],
  "checkId": "q3Xc…",
  "feedbackKey": "Hk2…"
}

What is measured

  • Interaction (up to 40 points): how someone uses the page with mouse, finger or keyboard, measured against laws that apply to every human. We deliberately don't name the individual signals, so bots can't copy them. The verify response also summarizes them per layer.
  • Browser, network, puzzle, extra check (up to 60 together): technical traces of automation, where the connection comes from, a puzzle in the background and an independent second opinion.
  • Traps for forgeries and AI agents: the server checks reported values against its own measurements. The AI trap in the form can be turned off with data-bait="off".
  • Password fields are never analyzed character by character.
  • Missing movement never costs points, only clearly programmed traces do.

Recommendation per use case

recommendation.action is allow, step-up (extra step) or block, with a reason in reason and a note for the visitor in hint. Clear automation is always blocked. Unsure cases get an extra step instead of a dead end. Logins and payments are never blocked on the score alone, because a wrong call there locks out real customers.

useExtra step on step-up
loginAsk for a second factor or an email code
signupConfirm the email address before the account is active
commentHold for review
contactAccept, but mark as possible spam
checkoutAsk for an extra payment confirmation (3-D Secure)
formAsk for an extra confirmation, e.g. by email
pageLet the visitor tick the “I am human” box once

4. Feedback: was it spam?

With checkId and feedbackKey from the response, you can report later whether it was spam ("spam") or real ("legit"). Only whoever redeems the token gets the key, so only you. Human Check measures its error rates in production from this feedback.

await fetch("https://placeforhumans.org/api/v1/feedback", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ checkId: check.checkId, feedbackKey: check.feedbackKey, outcome: "spam" }),
});

Pages that submit with JavaScript (fetch, React, Vue …)

If you submit with JavaScript, get the token yourself and send it along:

const { token } = await humanCheck.getToken(); // optional: "#my-widget"
await fetch("/api/contact", { method: "POST", body: JSON.stringify({ text, token }) });

Gate: protection for the whole site

Like Cloudflare, just without moving your domain: a small module on your server guards the door. Try it here.

  • Normal mode: visitors get the page right away. Human Check checks invisibly in the background as soon as someone uses the page. On success your server sets a cookie, and there's peace for 7 days. After that, Human Check re-checks silently in the background.
  • Check page: only shown to visitors who haven't passed after a few page views or who don't request like a browser. When unsure, they tick the “I am human” box there once.
  • Attack mode: turns itself on during a surge. Then everyone without a cookie only gets the small check page, and your application is spared.
  • Rate limit: anyone sending more than 120 requests per minute without a passed check is slowed down.

1. Get the module and choose a secret

# into the folder the template for your platform names
curl -o humancheck-gate.ts https://placeforhumans.org/humancheck-gate.ts
# without TypeScript: https://placeforhumans.org/humancheck-gate.js

# secret for the cookie, e.g. as the environment variable HUMAN_CHECK_SECRET
openssl rand -hex 32

2. Template for your platform

Next.js (on Vercel or your own server)

File: proxy.ts and humancheck-gate.ts next to app/ (or in src/). Up to Next.js 15, file and function are called middleware. Secret: vercel env add HUMAN_CHECK_SECRET

import { NextResponse, type NextRequest } from "next/server";
import { humanCheckGate } from "./humancheck-gate";

export function proxy(request: NextRequest) {
  return humanCheckGate(request, { secret: process.env.HUMAN_CHECK_SECRET! }, () => NextResponse.next());
}

// Skip Next.js internals
export const config = {
  matcher: ["/((?!_next/static|_next/image).*)"],
};
Vercel with another framework or plain HTML

File: middleware.ts and humancheck-gate.ts in the project folder, next to package.json. Secret: vercel env add HUMAN_CHECK_SECRET · Needs once: npm install @vercel/functions

import { next } from "@vercel/functions";
import { humanCheckGate } from "./humancheck-gate";

export default function middleware(request: Request) {
  return humanCheckGate(request, { secret: process.env.HUMAN_CHECK_SECRET! }, () => next());
}
Netlify

File: netlify/edge-functions/humancheck.ts, humancheck-gate.ts in the project folder. Secret: netlify env:set HUMAN_CHECK_SECRET "$(openssl rand -hex 32)"

import type { Config, Context } from "@netlify/edge-functions";
import { humanCheckGate } from "../../humancheck-gate.ts";

export default (request: Request, context: Context) =>
  humanCheckGate(
    request,
    { secret: Netlify.env.get("HUMAN_CHECK_SECRET")!, ip: () => context.ip },
    () => context.next(),
  );

export const config: Config = { path: "/*" };
Cloudflare Workers

File: src/index.ts and src/humancheck-gate.ts, as a route in front of your domain or with static assets. Secret: npx wrangler secret put HUMAN_CHECK_SECRET · With static assets, in wrangler.jsonc: "assets": { "directory": "./public", "binding": "ASSETS", "run_worker_first": true }

import { humanCheckGate } from "./humancheck-gate";

type Env = { HUMAN_CHECK_SECRET: string; ASSETS?: Fetcher };

export default {
  fetch(request: Request, env: Env): Promise<Response> {
    return humanCheckGate(
      request,
      { secret: env.HUMAN_CHECK_SECRET, ip: (r) => r.headers.get("cf-connecting-ip") },
      () => (env.ASSETS ? env.ASSETS.fetch(request) : fetch(request)),
    );
  },
};
Cloudflare Pages

File: functions/_middleware.ts, humancheck-gate.ts in the project folder. Secret: npx wrangler pages secret put HUMAN_CHECK_SECRET

import { humanCheckGate } from "../humancheck-gate";

export const onRequest: PagesFunction<{ HUMAN_CHECK_SECRET: string }> = (context) =>
  humanCheckGate(
    context.request,
    { secret: context.env.HUMAN_CHECK_SECRET, ip: (r) => r.headers.get("cf-connecting-ip") },
    () => context.next(),
  );

Other servers with web-standard Request and Response (Deno, Bun, Hono) work the same way: return humanCheckGate(request, { secret }, () => servePage()).

3. Script on every page

So that the background check runs, add this once to your layout:

<!-- HTML: in the <head> of every page -->
<script src="https://placeforhumans.org/humancheck.js" data-watch defer></script>

// Next.js: in app/layout.tsx
import Script from "next/script";
<Script src="https://placeforhumans.org/humancheck.js" data-watch strategy="afterInteractive" />

Options

secretRequired. Long random string, signs the cookies.
hoursHow long a passed visit counts, then it is re-checked silently in the background. Default: 168 hours (7 days).
freeViewsPage views without a passed check while the background check runs. 0 = check page right away. Default: 5.
attackAttack mode: true = everyone without a cookie gets the check page right away. Default "auto": turns itself on for 10 minutes during a surge.
rateLimitRequests per minute and IP without a passed check, above that 429. Five times as many with a cookie. 0 = off. Default: 120.
searchEnginesLet Google, Bing and Apple through after a DNS check. Default: on.
skipFunction (url) => boolean for addresses that are never checked, e.g. APIs for apps, webhooks and uptime monitors. Images, fonts, styles, scripts, robots.txt and sitemaps are always open.
ipFunction that returns the visitor's IP (for rate limiting and search engines). Default: your host's X-Forwarded-For.
langLanguage of the check page: "de" or "en". Default: based on the visitor's browser language.
  • Your host protects against network-level floods: Vercel, Netlify and Cloudflare have that built in. The gate keeps the flood away from your application: in attack mode, unchecked requests only get a small, static check page, without database and without rendering.
  • The counters for rate limiting and surges live in your server's memory. With many instances running in parallel (e.g. on Vercel or Netlify), each one counts for itself.
  • The gate recognizes search engines by their origin, not just their name: the IP must belong to Google, Bing or Apple according to DNS. robots.txt and sitemaps are always reachable.
  • The gate needs code on your server. Purely static sites without a server can't use it this way.
  • Visitors need JavaScript. If your Content Security Policy restricts third-party scripts, add placeforhumans.org for scripts and frames.

Help for visitors

  • Reload the page and submit again.
  • Turn off your VPN or proxy.
  • Allow browser extensions that block scripts for this site.
  • Use an up-to-date browser.

Limits and fairness

  • Only counts (typing speed, clicks …) and the result are stored, without IP addresses and without the content of your forms. Everything is deleted after 90 days.
  • Up to 100 checks per hour per connection, so the service can stay free.
  • Without confirmation by the invisible extra check, a result is at most unsicher (unsure): everything a browser reports can be forged.
  • Text mode detects whether something was typed, not who wrote it. Someone retyping another person's text won't stand out.
  • Visitors from data centers and VPNs get a lower score. Decide with score how strict you want to be.
  • Free and without warranty. No system detects bots with absolute certainty.