Nov 22, 2026 Codequiry is now free to start, with unlimited Hexagram™ peer plagiarism scans. See plans →

What MOSS misses

MOSS tells you which students in a class turned in code that looks a lot alike, and CS departments have leaned on it for decades. What it cannot tell you is whether a submission is original. Code copied from Stack Overflow or GitHub, code ChatGPT wrote, and a classmate's code with the loops reworked can all come back with a low score or no match at all, so a low MOSS score is not a clean bill of health. Below is one example of each, along with what the MOSS page and the research say.

Checks every file against classmates, the web and AI, in 65+ languages.

Same function, rewritten line by line Does exactly the same thing. Very few token runs in common.
Example
Originalstats.py
1def find_max(numbers):2 maximum = numbers[0]3 for n in numbers:4 if n > maximum:5 maximum = n6 return maximum
Rewrittenstats.py
1def find_max(numbers):2 maximum = numbers[0]3 index = 04 while index < len(numbers):5 value = numbers[index]6 if not (value <= maximum):7 maximum = value8 index = index + 19 return maximum
Behavior: identicalNames: unchangedToken runs in common: few

The loop and the comparison were rewritten (highlighted). MOSS fingerprints runs of tokens, and almost every run in this function changed.

How MOSS works

You upload a batch of files to MOSS. It strips each one down to tokens, so variable names, comments and spacing stop mattering. Then it fingerprints short runs of those tokens (the method is called winnowing) and lists the pairs of files that share the most.

That is why renaming variables will not get anyone past it. It also explains where it falls short:

It only sees what you upload

MOSS compares the files you send it with each other. As far as it knows, Stack Overflow, GitHub, tutorial sites and last year's submissions do not exist unless you upload them too.

AI-written code

Ask ChatGPT the same question twice and you get two different programs. AI-written submissions usually do not match each other, so MOSS has nothing to flag.

Reworked statements

Change enough of the token runs and the fingerprints change with them, even if the program still does exactly the same thing.

Results that expire

The MOSS page says results are typically deleted after 14 days. If a case might go to a hearing, save the report yourself.

What the research says

Alex Aiken, who wrote MOSS, says as much on the MOSS page, and several research groups have tested these gaps directly. Here is what they found, quoted from the source:

  1. “while Moss automatically detects program similarity, it has no way of knowing why codes are similar.”
    Alex Aiken, Stanford UniversityMOSS documentationRead it

    The same page adds that "it is a misuse of Moss to rely solely on the similarity scores."

  2. “Mossad is effective at defeating four plagiarism detectors, including Moss and JPlag.”
    Breanna Devore-McDonald and Emery D. Berger, UMass AmherstOOPSLA 2020Read it

    Their tool rewrites a copied program automatically, in minutes, into variants that are "classified as no more suspicious than legitimate assignments."

  3. “they are vulnerable to advanced obfuscation based on structural modification of program code that preserves the original program behavior.”
    Timur Sağlam and Larissa Schmid, Karlsruhe Institute of Technology2025Read it

    The authors maintain JPlag. The paper covers detectors in general, including rewrites done with AI.

  4. “a student using GPT-J ... can complete introductory level programming assignments without triggering suspicion from MOSS”
    Stella Biderman and Edward Raff2022Read it

    They also found the generated code "diverse in structure", so there is no single pattern for a similarity tool to look for.

  5. “Existing detection methods, such as MOSS and JPlag (based on similarity metrics) and GPTzero (AI detection), have mixed success in identifying AI solutions.”
    Kevin Wang, Seth Akins, Abdallah Mohammed and Ramon LawrenceIEEE CSCI 2023Read it

    They tested this in three courses: CS1, CS2 and databases.

  6. “ChatGPT generates code non-deterministically, and thus, traditional similarity detectors might not suffice to detect AI-created code.”
    Muntasir Hoq, Thomas Price, Bita Akram and colleagues, NC State UniversitySIGCSE 2024Read it

    Models trained for the purpose did catch it. They report "accuracy above 90%" on CS1 submissions.

Rewritten copies

The example at the top makes three small changes. None of them changes what the program does:

  • The for loop becomes a while loop with its own counter, index = index + 1.
  • The comparison is flipped and negated: n > maximum becomes not (value <= maximum).
  • The current element gets its own variable, value = numbers[index].

A student does not have to be clever to do this, and these days they do not have to do it by hand either. Devore-McDonald and Berger's Mossad does it automatically in minutes, and Sağlam and Schmid found that detectors in general struggle with this kind of change, including when AI does the rewriting. Put the two files side by side, though, and any TA can tell it is the same function.

What catches it: comparing the structure of the program rather than runs of tokens, and someone actually reading the top pairs. Codequiry's Zeus engine was built for restructured code like this.

What Codequiry catches that MOSS cannot

A Codequiry check does the same class-wide comparison MOSS does. It also checks every file against GitHub, Stack Overflow, Gist, Software Heritage and the open web, and runs two AI detection models on it. Here are the three cases MOSS cannot help you with.

Copied from Stack Overflow

A student finds an answer, renames everything and hands it in. Nobody else in the class used that answer, so there is no second file for MOSS to match it to.

A Stack Overflow answer, renamed Same logic and structure, new names.
Example
Student submissionbrackets.py
1def check_brackets(expr):2 match = {')': '(', ']': '[', '}': '{'}3 opened = []4 for c in expr:5 if c in '([{':6 opened.append(c)7 elif c in match:8 if not opened or opened.pop() != match[c]:9 return False10 return not opened
Stack Overflow answeranswer
1def is_balanced(s):2 pairs = {')': '(', ']': '[', '}': '{'}3 stack = []4 for ch in s:5 if ch in '([{':6 stack.append(ch)7 elif ch in pairs:8 if not stack or stack.pop() != pairs[ch]:9 return False10 return not stack
Classmates with this code: noneMOSS: no matchCodequiry: matched to Stack Overflow

Every name changed (highlighted). Renaming alone would not fool MOSS. The trouble is that MOSS only compares this file with the others you uploaded, and nobody else in the class used this answer.

Copied from GitHub

Students post their homework to GitHub after the course ends, and the next class finds it. Some instructors go as far as filing takedown requests to get those repos removed. Unless you upload every one of them with the batch, MOSS never sees them.

Last year's homework, off a public GitHub repo Same messages, same odd log format, different names.
Example
Student submissionAccount.java
1public boolean withdraw(double amount) {2 if (amount <= 0) {3 System.out.println("Invalid amount entered.");4 return false;5 }6 if (amount > funds) {7 System.out.println("Insufficient funds. Balance: $" + funds);8 return false;9 }10 funds -= amount;11 log.add("W:" + amount);12 return true;13}
Public GitHub repositoryBankAccount.java
1public boolean withdraw(double amt) {2 if (amt <= 0) {3 System.out.println("Invalid amount entered.");4 return false;5 }6 if (amt > balance) {7 System.out.println("Insufficient funds. Balance: $" + balance);8 return false;9 }10 balance -= amt;11 history.add("W:" + amt);12 return true;13}
Classmates with this code: noneMOSS: no matchCodequiry: matched to GitHub

Only the names changed (highlighted). Two students do not independently come up with the same error messages and the same W: log entries. Details like that lead straight back to the repo.

Written by AI

There is nothing to match. The code did not exist anywhere until the student asked for it, so the only thing that can say anything about it is a check built for AI-written code.

A CS1 exercise, written by an AI assistant No match in the class, on the web, or in past terms.
Example
Student submissionwords.py
1def count_word_frequencies(text: str) -> dict[str, int]:2 """Return how often each word appears in the text."""3 frequencies: dict[str, int] = {}4 for raw_word in text.lower().split():5 # Strip punctuation so "end." and "end" count once6 word = raw_word.strip(".,!?;:()")7 if word:8 frequencies[word] = frequencies.get(word, 0) + 19 return frequencies
  • Peer comparison (MOSS)No match
  • Web checkNo match
  • AI detection: Classification ModelLikely AI-written
  • AI detection: Pattern & Style RecognizerConsistent with AI-written code

Both comparisons come back clean because there is nothing to compare against. Codequiry's Classification Model is trained on 100,000 AI-written and 100,000 human-written samples and updated as new models come out. As with any AI check, treat a flag as a reason to talk to the student, not as proof.

Two recent flags

Pythonsubmission.py 82%
9rfile = arcpy.GetParameterAsText(2)10if ( in rfile):11 (root,ext) = rfile.split()12else:13 root = rfile; ext = 14if (ext != ):15 rfile = root + 16outfile1= open(os.path.join(outdir,rfile),)17rfile2 = root2 = ext2 =
225 lines copied Found on mael-lenoc.fr · recently
Csubmission.c 100%
105static struct option gLongOptions[] = {106 {, required_argument, NULL, },107 {, required_argument, NULL, },108 {, no_argument, NULL, },109 {, no_argument, NULL, }, 110 {, required_argument, NULL, }, 111 {NULL, 0, NULL, 0}112};113
57 lines copied Found on GitHub Gist · 3 weeks ago

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

Check what MOSS cannot see

Run the same batch against classmates, past terms, GitHub, Stack Overflow, the web and AI.

What to do about it

Keep using MOSS if it works for you. Just do not treat its report as the final word, which is what the MOSS page says too. In practice that looks like this:

  1. Keep running the peer comparison, and upload the starter code as a base file so it does not show up as matches.
  2. Add a web check against GitHub, Stack Overflow and the wider web, and include past terms.
  3. Add an AI check. Use a flag as a reason to talk to the student, not as proof.
  4. Read the top pairs yourself. Shared bugs, strange variable names, identical error messages and leftover dead code tend to survive a rewrite.
  5. Save the reports before they expire.

Codequiry does steps 1 to 3 in one check and keeps every report. Weighing the free options? See MOSS vs Dolos vs JPlag, or our full guide to detecting code plagiarism.

Frequently asked questions

What is MOSS?

MOSS (Measure of Software Similarity) is a free service from Stanford that compares a batch of programs against each other. Alex Aiken wrote it in 1994. It is free for academic use, and a lot of CS departments have relied on it for years.

How does MOSS detect plagiarism?

Strictly speaking, it detects similarity. It reduces each file to tokens, fingerprints short runs of those tokens with a method called winnowing, and lists the pairs of files that share the most fingerprints. Names, comments and spacing do not count. Whether a similar pair is actually plagiarism is up to you.

What does MOSS miss?

Anything that is not in the batch you upload. That covers code from Stack Overflow, GitHub or other sites that no classmate also used, past terms you did not include, and code written by AI. It can also score low on a copy whose statements were reworked into equivalent forms.

Can MOSS detect ChatGPT or other AI-written code?

Not reliably. MOSS compares students with each other, and AI output usually differs from student to student. Biderman and Raff (2022) found AI-written solutions to introductory assignments did not trigger MOSS, and Hoq et al. (SIGCSE 2024) note that similarity detectors might not suffice for AI-created code.

Does a low MOSS score mean a submission is original?

No. It only means the file shares few token runs with the other files you uploaded. It could still be copied from the web, reworked from a classmate's code, or written by AI.

Should I stop using MOSS?

No need. It is a solid peer comparison. Just do not treat it as the whole check. Add a web check and an AI check, and read the top pairs yourself, which the MOSS page recommends anyway.

Sources

  1. Aiken, A. Moss: A System for Detecting Software Similarity. Stanford University. theory.stanford.edu/~aiken/moss
  2. Schleimer, S., Wilkerson, D. S. and Aiken, A. Winnowing: Local Algorithms for Document Fingerprinting. SIGMOD 2003. PDF
  3. Devore-McDonald, B. and Berger, E. D. Mossad: Defeating Software Plagiarism Detection. Proc. ACM Program. Lang. 4 (OOPSLA), 2020. doi:10.1145/3428206
  4. Biderman, S. and Raff, E. Fooling MOSS Detection with Pretrained Language Models. 2022. arXiv:2201.07406
  5. Wang, K., Akins, S., Mohammed, A. and Lawrence, R. Student Mastery or AI Deception? Analyzing ChatGPT's Assessment Proficiency and Evaluating Detection Strategies. IEEE CSCI 2023. arXiv:2311.16292
  6. Hoq, M., Shi, Y., Leinonen, J., Babalola, D., Lynch, C., Price, T. and Akram, B. Detecting ChatGPT-Generated Code Submissions in a CS1 Course Using Machine Learning Models. SIGCSE 2024. doi:10.1145/3626252.3630826
  7. Sağlam, T. and Schmid, L. Evaluating Software Plagiarism Detection in the Age of AI: Automated Obfuscation and Lessons for Academic Integrity. 2025. arXiv:2505.20158

See what your last MOSS batch missed

Upload the same files and check them against classmates, past terms, GitHub, Stack Overflow, the web and AI.

Get started Every plan includes Deep Scans.
From instructors

What instructors say

  • Codequiry protects our course from copying. It's the only reliable tool we've found.
    Course instructor
  • Codequiry has been the best experience I've had checking source code against the web for plagiarism. It even covers Stack Overflow!
    Codequiry user
  • As a professor at Stanford, I want to make sure students submit code they wrote themselves. Codequiry checks their code against the web for plagiarism, something other checkers can't do.
    Professor, Stanford University
Sources

Tools referenced on this page

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

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.