Free tool

AI code detector

Paste code and see how likely it is that an AI model wrote it, and why.

Paste a function or a file and get the probability that an AI model wrote it, with the signals behind the call. Free, no account, up to 12,000 characters, any programming language.

Free check

Paste a code snippet

20 checks a day

Your code is sent to DeepSeek through OpenRouter for one check and is not stored. The answer is a probability, not proof.

Check it by hand
  • Comments say what each line does, in the same polished tone, instead of why it was done.
  • A short function carries a full docstring with Args and Returns sections that repeat the task.
  • Names are textbook generic (result, data, helper) with no project vocabulary.
  • Every input gets defensive checks, even ones the calling code already guarantees.
  • The snippet stands alone: it rebuilds helpers the project already has, or ends with example usage.
  • No history at all: no TODO, no workaround for a known bug, no odd but deliberate choice.
  • Ask the author to explain one design choice and to walk through an edge case.
  • Look at the commit history: one large finished commit tells more than any detector.

How the AI detector works on your code

Most AI-generated code today comes from large language models, and they share habits a reviewer can spot. To detect AI-generated code, the AI detector uses another AI model, DeepSeek V4.1 Flash, with a fixed set of instructions: read the code to determine whether a model wrote it, the way a reviewer would, and explain why. It reports an AI probability score from 0 to 100 and up to six signals, each tied to something in the code, and checks the code in seconds.

  • 60 or more: Probably AI-written.
  • 30 to 59: Mixed signals. Edited AI code and very tidy human code both land here.
  • Under 30: Probably written by a person.

This is pattern recognition to identify habits, not a hidden watermark. Even advanced AI models leave these habits in code generated by AI, which is why the same check works on code from different assistants.

How to detect AI in code by hand

The signals are things a reviewer would point at, and you can look for them yourself when the daily checks run out:

  • Comments that narrate every line, including the obvious ones.
  • A full docstring on a five-line helper.
  • Defensive checks the caller already makes.
  • Textbook names with no project vocabulary.
  • No history at all: no TODO, no workaround, no comment about a bug someone hit.

Code written by humans tends to be uneven: thorough where the author got burned before, terse where they were in a hurry. One signal proves nothing; several together are worth a question.

AI code detection accuracy and false positive rate

We tested it on 30 snippets of AI-generated and human-written code in Python, JavaScript, Go, Java and Rust before release. Fifteen were written by people, taken from open-source projects with commits from before 2021. Fifteen were written for the same tasks by two AI models, DeepSeek and Gemini.

  • 26 of 30 were called correctly, 87%.
  • None of the 15 human snippets was flagged as AI-written: a false positive rate of 0 in 15.
  • 11 of the 15 AI snippets were caught. Most misses were bare DeepSeek code with no comments.

The detector is tuned to reduce false positives: when it is unsure, it says Mixed signals rather than AI, so far fewer human snippets get flagged as AI. A sample of 30 is small, and the human code came from public projects a model may have seen in training, so treat this level of accuracy as a rough guide.

Key pointA probability is not proof. Use the result to decide what to ask the author, never as the only evidence.
RelatedAI attractiveness test1-10How we kept a model from rating every face a 7.

When to check if code is AI generated

The AI code detector helps most where the question is who did the work, not whether the code runs. It is a quick check, not a comprehensive analysis of quality or security; for that, use tools that analyze code for bugs.

  • Code review. A high score tells a reviewer which parts to question and helps identify potential issues: untested edge cases, checks that hide a bug, comments that describe what the code was meant to do rather than what it does.
  • Academic integrity. A teacher can see which submissions to talk through with the student, under the school’s AI usage policies. The score starts the conversation; it does not settle it.
  • Hiring tests. A take-home task that reads as AI-written is a reason to ask the candidate to extend it live.

Supported languages

The AI code detector supports any language the model can read, so one AI code checker works across multiple languages: Python, JavaScript, TypeScript, Java, C#, C++, Go, Rust, PHP, Ruby, Lua and more. The habits it looks for are about comments, names and structure, not one syntax. Accuracy was measured on Python, JavaScript, Go, Java and Rust only.

AI and plagiarism: what a score cannot prove

No AI code detector can prove who wrote code, and AI detectors don’t detect plagiarism: copying code from another person and generating it with a model are different problems. The AI code detector provides a probability, rather than definitive proof that the code was generated by a model. Short snippets carry few signals, code that a person edited after a model wrote it reads as mixed, and code written to a strict style guide can look machine-made. Plain, uncommented code from a model is the hardest case.

No AI detection tool is accurate and reliable enough to be the only evidence. Use the result as part of a broader review: for a decision that matters, such as a class assignment or a hiring test, the checklist above and a short conversation with the author tell you more. Ask them to explain one design choice and to walk through an edge case, and look at the commit history.

What happens when you paste your code

We do not store the code you paste, whether it is a snippet or AI-generated source code from your own project. It is sent once to OpenRouter, which passes it to the model host (DeepInfra or Inference.net) with data collection for training turned off. We keep only the answer for seven days, filed under a fingerprint of the code, so the same snippet gets the same result without a second call. Each visitor gets 20 checks a day.

RelatedHow much water does AI use?0.26mL for the lowest published estimate per prompt.

FAQ about this free AI code detector

Is this AI code detector free?

Yes. There is no account and no signup. Each visitor gets 20 checks a day, and if the daily budget runs out, the page shows the hand checklist instead.

How do you detect AI generated code?

Look for the habits above: narrating comments, docstrings everywhere, generic names, defensive checks and no history. Detecting whether code came from a model is easier on a whole file than on a few lines, and easier on code nobody has edited since.

What is the best AI detector for code?

One that explains its call. A bare percentage gives you nothing to check, while signals tied to lines of code let you judge the result yourself. Whatever tool you use, treat the score as a reason to ask the author, not as an answer.

Can it detect code from ChatGPT, Claude or Copilot?

It looks for habits that AI models share rather than the fingerprint of one product, so it can flag code from any of them. We tested it on code from DeepSeek and Gemini only, so we cannot give a separate accuracy for each assistant.

Can teachers detect AI-written code?

Often, but not from the code alone. Detectors give a probability, and they miss plain code with no comments. Asking the student to explain their choices, or checking their commit history, is far more reliable.

Does Turnitin detect AI-generated code?

We have not tested Turnitin on source code. Ask your school which tool it uses for code and how it reads the result; for code, the author’s explanation and commit history are stronger evidence than any score.

Why did my own code get flagged?

Very clean code with complete docstrings, generic names and checks on every input looks like model output. If you wrote it, the commit history and your explanation of it are your evidence.

Sources

  1. gptx test of the detector, November 5, 2026: 30 snippets, 15 human (open-source projects, commits before 2021, MIT and Apache-2.0 licenses) and 15 AI (DeepSeek V4.1 Flash, Gemini 2.5 Flash-Lite)
  2. Model: DeepSeek V4.1 Flash through OpenRouter, hosted by DeepInfra or Inference.net

Spotted a mistake? Write to support@gptx.io and we will check it.

Keep reading