Short answer: Turnitin's AI writing detection is built for essays and other long-form prose, and Turnitin says so directly. It strips code out before calculating its AI percentage. That does not mean nobody will look at how your code was written, so it is worth understanding what Turnitin actually checks, what it skips, and what else your course might use. Everything below about Turnitin and Gradescope comes from their own help pages, which we read in October 2026; check the linked pages for the current wording.
What Turnitin says about code
Turnitin's AI writing detection FAQ covers this in two places. First, when it explains which text is left out of AI detection, it says the model removes strings it predicts are not actual sentences, including lists, headers, references, data tables and text that appears to be formulas or code. Second, when it defines the kind of writing it analyses, it says the model does not reliably detect AI-generated text in the form of non-prose or code. The same FAQ also says Turnitin is not pursuing ChatGPT code detection at this time.
The file requirements for an AI writing report point the same way. A submission needs at least 300 words of prose text in a long-form writing format, no more than 30,000 words, and a supported language (the page lists English, Spanish, Japanese and Arabic). A .py or .java file with a few comments does not fit that description.
What that means for a programming assignment
- Pure code submissions. If you submit only source code, Turnitin's AI percentage is not designed to say anything about it.
- Code plus a write-up. If your assignment includes a report, a reflection or long written answers, that prose can be scored for AI writing on its own terms. Turnitin notes that a document mixing several writing types can show a gap between the percentage and the highlighted text, because only qualifying prose is counted.
- Comments and docstrings. These sit inside code and are usually short, so they are unlikely to meet the long-form prose requirement. Do not read anything into a score either way.
- Similarity, not AI. Turnitin's similarity checking is a separate feature from AI writing detection. Whether and how your institution runs code through similarity checks depends on how your course is set up, so ask if you need to know.
What your instructor can still use
A missing AI score is not the end of the story. Programming courses rely on other checks, most of which have nothing to do with Turnitin:
- Code similarity tools. Gradescope's Code Similarity report compares students' programs with each other within one assignment and highlights matching blocks. Gradescope says it does not automatically detect plagiarism; it shows how similar two programs are. MOSS and JPlag work in a similar way. See does MOSS detect AI code for more on these.
- Your earlier work. A sudden change in naming, structure or comment style compared with your previous submissions is easy for a grader to notice.
- Course context. Techniques that have not been taught yet, or a solution far more general than the task, stand out.
- Talking to you. Many instructors ask students to walk through their code or make a small change. This is the check that matters most, and it is one you pass easily if you understand your own work.
For a fuller picture, read can professors tell if you used ChatGPT for code.
How Turnitin treats its own scores
Even for prose, Turnitin is careful about what its number means. Its FAQ says the AI percentage should not be used as the sole basis for action or as a definitive grading measure. It does not show a percentage for results between 1% and 19%, marking them with an asterisk instead, because false positives are possible. Its model release notes show the model is updated regularly, most recently in October 2026 for English, and that older reports are not re-scored unless the work is resubmitted. If your school raises a concern based on an AI score, these are fair points to bring up calmly.
Checking your own code before you submit
If you want to know how your code reads to someone looking for AI patterns, a prose detector will not tell you. A code-focused check will. Paste your solution into the detector at the top of this page and read the reasons it gives, not just the score. Things it commonly points out include comments that narrate every line, a demo block the task did not ask for, and very uniform naming. If those reflect how you actually write, that is fine; knowing about them just means you will not be surprised by a question.
A few habits help any honest student, whatever tools your course uses:
- Commit as you go. A Git history, or a few saved drafts, shows how your solution developed.
- Write comments for yourself. Explain why something is done, especially the tricky part, rather than describing each line.
- Know your policy. If your course allows AI help with disclosure, use it within those limits and say what you used.
- Be able to explain it. If you can walk someone through your code and change it on request, a detector result is a minor detail.
Read more
- My code was flagged as AI but I wrote it — what to do next.
- AI code checker for homework — the detector with a student focus.
- How to tell if code was written by ChatGPT — the signals reviewers look for.
Frequently asked questions
Does Turnitin's AI score include my code?
According to Turnitin's own FAQ, no. Its AI writing model removes text that looks like code, lists, tables or formulas before scoring, and the percentage is calculated only from the prose sentences that remain. Turnitin also states that the model does not reliably detect AI-generated code.
If Turnitin shows 0% AI on my programming assignment, does that mean my code looks human?
No. A 0% or missing AI score on a code submission mostly means the code was not analysed. It says nothing either way about how your code reads. If you want to know that, use a tool that is built to look at code.
Will the written part of my assignment be checked?
It can be. If you submit a report, README or written answers alongside your code, and that text meets Turnitin's requirements (at least 300 words of long-form prose in a supported language), the prose can receive an AI writing score even though the code does not.
Can my instructor still find out I used AI for code?
Yes, through other means. Similarity tools compare submissions within a class, instructors compare your work with your earlier assignments, and many courses ask students to explain their code. The safest approach is to follow your course's AI policy and disclose any help you were allowed to use.
Does Gradescope detect AI code?
Gradescope's Code Similarity feature compares students' programs with each other. Gradescope's own guide says it does not automatically detect plagiarism; it shows how similar two programs are within one assignment. It is not described as an AI detector.
Try the detector
Have a snippet you are unsure about? Paste it into the free AI Code Detector to get a verdict, an AI probability and the reasons behind it. No sign-up, and your code is not stored.