AI CODE · BETA
Was This Code Written by an AI Assistant?
The AnyFact code detector scores each function and lists style cues. It is the least reliable of our detectors, so we say so upfront.
Open in beta · 10 free credits a month · Files deleted after 30 days
AI Code Detector
Open in betaWhat you need
Paste at least 30 lines of code
At least 30 lines; Python, JavaScript, TypeScript, Java, PHP, C/C++ and more.
At a glance
Per function
Each function gets its own score, with the style cues that drove it.
AnyFact method
3 levels
Probably human, uncertain or probably AI — never a bare percentage — with the reasons and the limits of the method.
AnyFact method
10 credits
Free every month with an account, no credit card. Uploaded files are deleted after 30 days.
AnyFact free plan
Why code is the hardest content to judge
Good code is predictable by design: conventions, linters and frameworks push human and AI-written code toward the same style. That makes detection harder than for prose.
The AnyFact code detector measures how predictable each function is to a code-specialised open-source model (Qwen2.5-Coder) and highlights the functions that stand out.
Use the result as a conversation starter in an interview or a code review — never as proof.
Does this sound familiar?
- A take-home coding test looks unusually polished.
- A programming school reviews assignments.
- You want to understand how a contribution was written before merging it.
Here's what we check
Paste the code
At least 30 lines; Python, JavaScript, TypeScript, Java, PHP, C/C++ and more.
Function-by-function scoring
Each function gets its own score and style cues are listed.
A verdict in three levels
Probably human, uncertain or probably AI — never a bare percentage — with a short explanation and the limits of the method.
How to read the result
The signals point to a person. It is not a guarantee: a careful generator or heavy editing can leave few traces.
The signals disagree or are too weak. We say so rather than guess, and list what was found.
The signals point to generation. It is an indication, not proof — check the context before acting.
Sample layout. Real reports name the signals that were checked and the limits of the method.
How to detect AI-generated code, step by step
Paste the code you want to understand, read the score of each function, then talk with the author. The AI code detector is in beta and is the least reliable of our detectors, so the conversation matters more than the score.
- 01Paste at least 30 non-empty lines and up to 5,000 lines.
- 02Use a supported language: Python, JavaScript, TypeScript, Java, C, C++, C#, Go, PHP, Ruby or Rust.
- 03Leave out code you already know was machine-made, such as lock files, scaffolding output or vendored libraries.
- 04Keep functions whole, so each one can be scored on its own.
- 05Read the result function by function, then use it to prepare questions for the author.
When you review a pull request, paste the changed functions with enough surrounding code for each one to be complete. A code check uses 1 credit.
How to read an AI code detector result
Each function gets its own score, measured with the Fast-DetectGPT method and a code model (Qwen2.5-Coder). Read the pattern across functions rather than any single score.
| Pattern | Likely reading | Good follow-up |
|---|---|---|
| Most functions score AI | Much of the code may have been generated | Ask the author to walk through the design choices |
| A few functions stand out | Possibly generated helpers in hand-written code, or simply very standard code | Ask about those functions specifically |
| Mostly uncertain | Conventional code that looks the same whoever writes it | Rely on review and discussion, not on the detector |
| Mostly human | Nothing stands out to the model | Not a guarantee: review the code as you normally would |
Expect more uncertain results here than with our other detectors. Boilerplate such as getters, configuration and simple loops says little about who wrote it, so focus on the functions that carry real logic.
Signs of Copilot or ChatGPT code you can check yourself
A few traits are common in assistant-written code, but each has ordinary explanations too. Use them as prompts for questions.
| Sign | Why it is weak alone |
|---|---|
| Comments that narrate obvious lines | Some teams and courses require heavy commenting |
| Perfectly uniform naming and docstrings in one file, unlike the rest of the project | Formatters and linters also make code uniform |
| Calls to functions or packages that do not exist | A strong reason to ask, though typos and outdated APIs happen |
| Defensive handling for cases that cannot occur | Careful developers write defensive code too |
| A large, finished feature in a single commit | Some people squash their history before pushing |
Our guide on how to detect AI-generated code covers these checks and the reasons code is so hard to judge.
Copilot code detection in hiring and code review: what works better than a score
Understanding beats detection. A developer who wrote or truly understood the code can explain and change it; that is easier to check than authorship.
- 01State your AI policy in the brief of a take-home test or in your contribution guidelines.
- 02Ask the author to walk you through the code and the trade-offs they made.
- 03Request a small live change, such as a new edge case or a different data structure.
- 04Look at the commit history for how the work progressed.
- 05Use the detector result only to choose which parts to discuss.
Our page on hiring and recruiting shows how to build this into a technical interview, and are AI detectors accurate? explains why code results deserve extra caution.
Before you check
Is the result proof that a content was made by AI?▼
No. It is an indication, not proof. Detectors can be wrong in both directions, especially on compressed, cropped, edited or very short content. Use the result to decide what to check next, not as a final judgement on anyone.
Why no percentage?▼
A single percentage suggests a precision no detector has. You get one of three levels — probably human, uncertain or probably AI — with the signals behind it and the limits of the method.
How does the analysis work?▼
When the content carries provenance data, such as C2PA content credentials or metadata, we read it first. Then an open-source detector scores the content. When the score is borderline, Claude reviews it as a second opinion, and the result is explained in plain words.
What happens to my files?▼
They are processed to run your analysis — including, for borderline cases, a review by Claude, Anthropic’s model — and deleted after 30 days.
What does it cost?▼
There is a free plan: a free account gets 10 credits every month, with no credit card. Pro ($15 a month) gives 1,000 credits a month; Business ($49 a month) gives unlimited Business Checks and AI checks under a fair-use limit.
Is this detector reliable?▼
It is the least reliable of our detectors, because good code is predictable by design. Use the result as a conversation starter, never as proof.
Which programming languages does the AI code detector support?▼
Python, JavaScript, TypeScript, Java, C, C++, C#, Go, PHP, Ruby and Rust.
Why does it need at least 30 lines of code?▼
Short snippets give the model too little to work with, and very short code tends to look the same whoever writes it. The minimum is 30 non-empty lines.
Can it check a whole repository?▼
Not in one go. It analyses pasted code of up to 5,000 lines, so choose the files or functions that matter for your question.
Does it tell whether code came from Copilot, ChatGPT or Claude?▼
No. It measures how predictable each function is to an open-source code model, which does not identify the assistant used. The result says whether a function looks generated, not by which tool.
Check a piece of code, function by function
What you need
Paste at least 30 lines of code
Free plan — 10 credits every month, no credit card.
Each result is an indication, not proof.
Files deleted after 30 days.
You might also want to check
Was This Text Written by AI?
Free AI text detector and AI writing checker: paste a text to see which passages were probably written by AI, with an explained verdict. English, French, Arabic.
Was This Document Made With AI?
Check the text, images and metadata of a PDF, DOCX or PPTX file, page by page, with a verdict explained in plain words. Free plan.
How Much of This Website Is AI-Generated?
AI-generated website checker: explore up to 20 pages of a site, check their text and images for AI and add trust signals such as domain age. Free plan.