New Breakthrough Catch AI-written code before you grade it. Our most accurate model yet. It finds 90% of AI and GPT code with only 1.3% false flags. 90% caught, 1.3% false flags. Start checking Start checking
New: MCP integration. Run plagiarism scans from Claude, Cursor or any AI assistant. Run scans from Claude or Cursor. Set it up

Code plagiarism: what it is and how to detect it

Code plagiarism is submitting source code that was written by someone else, whether copied from a classmate, downloaded from the web, or generated by an AI like ChatGPT, and presenting it as your own work. Renaming variables does not hide it, because detectors compare a program's structure, not its text.

2-day free trial. Checks every file against classmates, the web and AI, in 65+ languages.

97%
Copied from GitHub with every name changed 8 of 8 lines match the original
Example
Student submissionlab4.py
1def flip(node):2 back = None3 while node:4 ahead = node.next5 node.next = back6 back = node7 node = ahead8 return back
Found on GitHubreverse.py
1def reverse(head):2 prev = None3 while head:4 nxt = head.next5 head.next = prev6 prev = head7 head = nxt8 return prev
Web sources: 1 matchClassmates: no matchAI detection: not flagged

The most common case: a known solution with the names swapped. Highlighted are the student's renames. The logic, line for line, is the original.

Used in programming courses at

  • Harvard University
  • Stanford University
  • ETH Zurich
  • MIT
  • University of Cambridge
  • University of Illinois Urbana-Champaign

Source code plagiarism is no longer just students copying each other. It now includes AI code generators, solutions translated from one language to another, and edits made only to get past a checker. This guide covers what counts, how code plagiarism detection works, and how to handle a match fairly.

What counts as code plagiarism?

Any code you hand in as your own that you did not write, without the credit or permission the assignment requires. In practice it takes six forms:

  • Copying a classmate. Two students hand in the same program, often with the names changed. This includes working together more than the assignment allows.
  • Copying from the web. A solution lifted from GitHub, Stack Overflow or a tutorial site, whole or stitched together from several sources.
  • Cosmetic edits. Renamed variables, rewritten comments or new formatting over someone else's logic.
  • Translating between languages. A Python solution rewritten in Java with the same structure.
  • Undisclosed AI code. Code generated by ChatGPT, Claude, Gemini or Copilot in a course that does not allow it.
  • Recycled solutions. A previous term's submission handed in again.

Whether AI help is allowed depends on the course, so the rule belongs in the syllabus. Students: if it is not written down, ask before you use it.

How common is code plagiarism?

Very. In the last seven days Codequiry checked 158 submissions and flagged 92 of them at 70% similarity or more. 46 matched code already online and 47 matched a classmate's work.

It is not new either. In Donald McCabe's surveys of more than 70,000 students, 58% admitted to plagiarism (International Center for Academic Integrity).

Two recent flags

Javasubmission.java 94%
384System.out.println();385System.out.println();386System.out.println( + userID);387System.out.println(388 + robotSerialNumber);389System.out.println(390 + carSerialNumber);391System.out.println(392 + deliveryTime);
160 lines copied Found on the web · 1 day ago
SQLsubmission.sql 86%
25CREATE TABLE Bookings (26 check_in DATE,27 check_out DATE,28 cancelled BOOL,29 g_id INT,30 e_id INT,31 r_id INT,32 b_id INT,33 CONSTRAINT PK_Bookings PRIMARY KEY (b_id),
156 lines copied Found on the web · 13 hours ago

Real flags from Codequiry. Student names, comments and strings are removed before anything is shown here.

How code plagiarism detection works

Renaming variables never works because detectors do not compare the text you see. They compare the structure underneath it. Every serious tool follows roughly the same steps:

  1. Tokenize. Each file becomes a stream of tokens. Names, comments and whitespace drop out, so int totalSum = 0; and int x = 0; look the same.
  2. Fingerprint. Runs of tokens are hashed into compact fingerprints. MOSS popularized the winnowing algorithm for this; JPlag uses greedy string tiling (RKR-GST).
  3. Compare structure. Fingerprints, syntax trees (AST) and control flow are compared to find the longest shared regions. Comparing structure is what catches code translated from one language to another.
  4. Look outside the class. Peer comparison only finds copying between the files you upload. Codequiry also checks every file against web sources and past terms, and runs an AI classifier on it.
  5. Review the evidence. You get a similarity score and the matched lines side by side. The score tells you where to look. A person makes the call.

A high score is a signal, not a verdict. Short programs and starter code can score high between honest students, and a deliberately disguised copy can score lower. Read the matched lines before deciding. There is a full walkthrough in how to detect code plagiarism.

Why MOSS alone isn't enough

MOSS (Measure of Software Similarity) and JPlag were the standard for decades, and they are good at one question: did two students in this batch hand in similar code? A solution copied from GitHub or written by ChatGPT passes both if no classmate handed in the same thing.

CapabilityMOSS / JPlagCodequiry
Peer-to-peer similarityYesYes
Web & open-source matchingNoYes
AI-generated code detectionNoYes
Cross-language detectionLimitedYes
Compare against past termsNoYes
Languages supported~2565+

For the full breakdown, read Codequiry vs MOSS and Codequiry vs Dolos vs MOSS.

Checking code plagiarism with Codequiry

Codequiry is a code plagiarism checker built for programming courses. You upload a folder of submissions and every file is checked in one pass:

  • Against classmates and past terms, by structure, so renamed and reformatted copies still match.
  • Against web sources such as GitHub and Stack Overflow.
  • By an AI code detector trained on ChatGPT, Claude, Gemini and Copilot output.
  • In 65+ languages, including solutions translated from one to another.

Each result is a score with the matched lines side by side, ready to share in an integrity case. It is used by educators worldwide.

Check your next assignment

Upload the submissions as a zip. Results come back in minutes.

Start free trial

2-day free trial

Keeping the process fair

A checker finds the matches. What happens next is what students remember.

  • Check every assignment, not only the suspicious ones. Checking everyone the same way removes bias and is the strongest deterrent.
  • Write the rules down. Say what collaboration and AI use are allowed, assignment by assignment.
  • Read the evidence before deciding. Look at the matched lines and the context, then talk to the student.
  • Design for it. Change the specification each term and ask students to explain their code.

Frequently asked questions

What is code plagiarism?

Code plagiarism is the submission of source code that was written by someone else, whether copied from a classmate, downloaded from the web, or generated by an AI like ChatGPT, and presented as your own work. Unlike text plagiarism, code plagiarism is detected by analyzing program structure rather than literal text, so renaming variables or reformatting whitespace doesn't hide it.

How is code plagiarism detected?

Code plagiarism detection tokenizes source code, normalizes it (stripping comments, whitespace, and identifier names), and compares token sequences using fingerprinting algorithms like MOSS, JPlag, Dolos, and Zeus. Modern tools like Codequiry add web source matching and AI-generated code classifiers.

Is AI-generated code from ChatGPT considered plagiarism?

Most academic institutions classify undeclared use of AI-generated code as plagiarism or academic misconduct. Codequiry's AI code detector flags ChatGPT, Claude, Gemini, and Copilot output so educators can enforce their policy consistently.

Can you get caught using ChatGPT to write code?

Yes. AI-generated code has statistical fingerprints, such as unusually uniform structure, textbook naming, and comment patterns, that classifiers are trained to recognize. Codequiry combines an AI-code classifier with a check against web sources, so submissions that were generated or copied are flagged even when variable names are changed.

Does MOSS detect AI-generated code?

No. MOSS compares submissions to each other within a batch using winnowing fingerprints. It does not search the public web and has no AI-code classifier, so a solution copied from GitHub or generated by ChatGPT can pass MOSS if no classmate submitted something similar. Codequiry adds web-wide source matching and AI detection on top of peer-to-peer comparison.

What similarity percentage counts as plagiarism?

There is no universal threshold. A high similarity score is a signal to investigate, not proof. Short or boilerplate programs can share 80 percent or more legitimately, while a deliberately obfuscated copy may score lower. Educators should read the side-by-side matched regions and consider context before making a determination.

Can code plagiarism be detected across programming languages?

Yes. Because modern detectors compare program structure, such as token sequences, abstract syntax trees, and control flow, rather than literal text, they can catch a solution that was translated from Python to Java while keeping the same logic. Codequiry supports over 65 programming languages.

Can plagiarism detection tools make mistakes?

Yes, which is why a match should start an investigation, not end one. Very short programs, starter code and common algorithms can match between honest students. Read the matched lines side by side and consider the assignment before deciding.

Is copying code from Stack Overflow plagiarism?

It depends on the assignment. Small, credited snippets are normal in professional work and some courses allow them. If the rules do not say, ask your instructor, and always credit the source.

Does collaboration count as code plagiarism?

It depends on the assignment. Discussing ideas is usually fine, but unless the assignment says otherwise, each student is expected to write their own code.

Can I reuse my own previous code?

Reusing code you handed in before is called self-plagiarism, and policies vary. Most courses expect new work for each assignment, so check with your instructor first.

What if I am falsely accused of code plagiarism?

Use your institution's appeals process and bring evidence that you wrote the code: version history, drafts, notes, and being able to explain it line by line.

See what's in your next assignment

Upload a class's submissions and see which ones match classmates, the web or AI, with the lines side by side.

Start free trial

2-day free trial

Just one assignment? Run a single check

Tools and sources referenced on this page

Codequiry is compared with these tools above. Each link goes to the project's official site so you can check the claims yourself.

  • MOSS (Measure of Software Similarity) Stanford University, Alex Aiken

    Free academic similarity service from 1994 that fingerprints code with winnowing and reports matching passages between submissions.

  • JPlag Karlsruhe Institute of Technology, open source

    Open-source token-based detector that compares programs with Greedy String Tiling and produces a similarity report per pair.

  • Dolos Ghent University, open source

    Open-source similarity tool built on tree-sitter parsing, with a web interface for exploring clusters of related submissions.

Topic index

Explore Codequiry's code plagiarism detection toolkit

Dig deeper into the most accurate source-code plagiarism checker on the market, every language, every detection engine, every academic-integrity use case.