Turnitin has a great AI detector (at least when it comes to false-positives) but can it detect AI code? The short answer is NO, but not because what you think of. It is not that all AI code pass as undetected, the fact is that Turnitin refuses to even analyze AI generated code. Let us explore what we found out in the small test that we ran but before that we will find how Turnitin's AI detection works.
How Turnitin's AI detection works?
Turnitin’s AI Writing Indicator relies on a deep-learning classifier dubbed AIW-2. Built on a transformer network, the same architecture that powers large language models, it has been trained on millions of genuine student papers plus essays produced by GPT-3.5/4. When a paper is uploaded, Turnitin chops the prose into overlapping windows of roughly five-to-ten sentences so every line is judged in context; the model assigns each sentence a probability from 0 (human-like) to 1 (AI-like) and averages the scores to estimate what share of the document was machine-written. wiki.srce.hrcte.ku.edu
To curb false alarms, Turnitin reveals an exact score only when 20% or more of the qualifying text looks AI-generated, anything between 1 and 19 percent shows an asterisk because that band produces more false positives. This conservative threshold keeps the document-level error rate below one percent. If the 20 % bar is cleared, a second model called AIR-1 runs over the flagged sentences to pinpoint the distinctive fingerprints left by AI “word-spinners” and paraphrasing tools, marking those lines in a different colour. The result is a two-layer report that lets instructors spot both direct AI output and AI-rewritten passages in seconds while keeping genuinely human work safe from mis-identification.
Can Turnitin detect AI code?
We tested 10 samples using Turnitin's AI detector with AI-generated code from ChatGPT (o3 model). For all of them Turnitin simply refused to process it and we got the error message "AI detection unavailable". So, we stopped testing any further samples because it seems like Turnitin's AI detector is incapable of processing/analyzing code, doesn't matter if it is AI-generated or not.
Here are some of the code snippets results:
1. This one said "AI detection unavailable" for Javascript code
2. This one had the same error for C++ code
3. This one had the same error for React JS code
As you can see from the examples above, Turnitin simply refused to process the results. But why is it so? Let us look at some possible answers.
Why Turnitin’s AI-writing detector skips code?
Here are some possible reasons that I could find out by reading their documentation and guides:
- Code isn’t “qualifying text” - Turnitin’s model is trained only on prose sentences in long-form writing. Their guide states the detector “does not reliably detect AI-generated text in … code.” Turnitin guide
- Below the 300-word prose threshold - An AI report runs only when a submission contains at least 300 words of prose. Braces, keywords and symbols inside programs don’t count, so most code files are skipped automatically. File-requirements doc
- High false-positive risk for deterministic patterns - Source code is highly repetitive and low-perplexity—the same statistical signals the detector flags as “AI-like” in essays. To avoid unreliable scores, Turnitin deliberately excludes code blocks. Turnitin guide
- Product scope: essays, not programs - All Turnitin documentation frames the detector as an aid for essays, dissertations and articles; programming languages fall outside its stated domain. Turnitin guide
- The grey “AI detection unavailable” badge - If a submission lacks enough qualifying prose—or uses an unsupported file type—the AI indicator turns grey with “– –”, meaning the detector was skipped, not that it tried and failed. Classic-view guide
The Bottom Line
So, there you have it. Turnitin’s AI detector may be great at identifying machine-written essays, but when it comes to AI-generated code, it simply doesn’t even attempt to process it. Our small test using 10 samples from ChatGPT (o3) resulted in “AI detection unavailable” every single time. This is because code doesn’t meet the “qualifying text” requirements, usually falls under the 300-word prose threshold, and is inherently low-perplexity. Turnitin clearly states their AI detector is aimed at catching machine-written prose, not programs. Therefore, if you are worried about AI detection for code, it seems unnecessary because Turnitin itself is skipping code blocks altogether. Of course, this might change in the future if they decide to expand beyond essays and research papers. But for now, Turnitin’s approach is laser-focused on textual, paragraph-based submissions, so your AI code will likely remain outside its detection radar.