Accused of Code Plagiarism by MOSS? What Code Similarity Really Means and How to Respond
Facing this situation right now? Get expert guidance today.
Key Takeaway
A MOSS or code similarity match shows structural overlap, not proof of copying. Here is why innocent similarity happens in CS courses, what to request, and how to show your own process.
What does a MOSS code plagiarism flag actually mean?
In short:A MOSS flag means a program found unusually similar structure between your code and another submission, and a person in the course decided the match was worth a closer look.
A MOSS flag means a program found unusually similar structure between your code and another submission, and a person in the course decided the match was worth a closer look. It is not a finding that you copied anything. Stanford's own MOSS page says the similarity scores are not proof of plagiarism, that someone must still look at the code, and that relying solely on the scores is a misuse of the tool.
If you are a computer science student and you just received an email about "code similarity" or "a MOSS report," you are probably anxious and maybe confused, especially if you wrote the code yourself. This guide explains what code similarity tools measure, why innocent similarity is common in programming courses, what to ask for, what evidence helps, and how to explain your process in a meeting. It applies to MOSS and to similar tools such as JPlag, Gradescope's code similarity feature and Codequiry, which work on related ideas even though the details differ.
How do MOSS and other code similarity tools work?
In short:Code similarity tools compare submissions to each other and highlight regions where the structure of the code lines up, then produce a ranked list of the most similar pairs.
Code similarity tools compare submissions to each other and highlight regions where the structure of the code lines up, then produce a ranked list of the most similar pairs. They are built to catch copying that has been disguised, so they usually look past surface changes such as renamed variables, different comments, reordered whitespace or reformatted lines.
That design is what makes them useful to instructors, and it is also what makes their output easy to misread. Because the tools ignore names and formatting, two students who solved the same small problem in the same standard way can produce code that looks "the same" to the tool even though each wrote it independently. The output is a list of pairs and percentages with highlighted blocks. It tells the instructor where to look. It does not tell anyone how the similarity came about.
A few practical points about these reports:
- The percentage is relative. It describes how much of each file overlaps with the other file, and the number can look large on a short program where only a few dozen lines are written by the student at all.
- Ranking is not a threshold. Many instructors review the top of the list, so someone's pair is always at the top even in a class where nobody copied.
- Shared code can be filtered, but only if it is supplied. The MOSS page describes eliminating matches to code that is expected to be shared, such as libraries or instructor supplied code. If the starter code was not provided to the tool, it can inflate the match.
Why does similar code happen innocently?
In short:Innocent similarity is common in programming because many assignments are small, tightly specified and taught with the same examples, so a large share of correct solutions end up looking alike.
Innocent similarity is common in programming because many assignments are small, tightly specified and taught with the same examples, so a large share of correct solutions end up looking alike. The tighter the specification, the fewer reasonable ways there are to write it.
Common innocent sources of similarity include:
- Starter code and templates. Function signatures, class skeletons, helper methods, test harnesses and file structure provided by the course can make up a large part of every submission.
- Narrow specifications. "Implement a linked list with these five methods" or "write a recursive function that returns the nth Fibonacci number" has only a few natural solutions.
- Lecture and textbook examples. If the instructor showed a pattern in class, many students will reproduce it closely, sometimes nearly line for line.
- Common tutorials and documentation. Official language documentation, popular tutorials and library examples show the same idioms to everyone.
- Stack Overflow and similar sites. A short snippet for reading a file, parsing input or sorting a list may appear in many submissions. Whether using it is allowed depends on your course policy, but it is a common reason two students' code overlaps.
- AI coding assistants. Tools such as Copilot or chat assistants tend to suggest similar code for similar prompts. Two students using an assistant on the same assignment can receive very similar output. This is innocent only if your course allows the tool, so read the policy carefully before you raise it.
- Permitted collaboration. Many courses allow students to discuss approaches at a whiteboard level. Discussing an algorithm with a classmate can lead to similar structure even when each person typed their own code.
None of these automatically clears you. They are reasons why a match is not, by itself, evidence of copying, and they point you toward what to check in your own case.
What does your course collaboration policy actually allow?
In short:Your course collaboration policy, usually in the syllabus or on the course website, defines what kind of help and sharing is allowed, and the case will usually turn on whether what happened fits inside or outside those lines.
Your course collaboration policy, usually in the syllabus or on the course website, defines what kind of help and sharing is allowed, and the case will usually turn on whether what happened fits inside or outside those lines. Computer science courses vary widely, so read your specific policy word for word rather than assuming.
Look for answers to these questions:
- May you discuss approaches with classmates? At what level of detail?
- May you look at another student's code, or show yours? Many courses prohibit this even for debugging.
- Are online sources such as Stack Overflow, tutorials or GitHub allowed, and must you cite them in comments?
- Are AI coding assistants allowed, restricted or banned? Some courses allow them for explanations but not for generating code.
- Is pair programming allowed on this assignment, and if so, with whom?
- What does the policy say about posting your code publicly, for example in a public GitHub repository that a later student might find?
Also read your school's general academic integrity rules and the procedure that applies to an accusation. The course policy defines the expectation, and the school policy defines how the case is handled, the standard of proof and your appeal rights.
What should you request after a code similarity accusation?
In short:Ask, in writing, for the specific evidence the accusation is based on so you can respond to it directly.
Ask, in writing, for the specific evidence the accusation is based on so you can respond to it directly. A short, polite email to the instructor or integrity office is usually enough.
Consider requesting:
- The matched files and the highlighted regions, so you can see exactly which parts of your code are said to match and which submission they match.
- The tool and settings used, including whether starter code was provided to the tool as a base file and excluded from the comparison.
- Any threshold or criteria used to decide which pairs were referred, and whether a person reviewed the code before the referral.
- The assignment specification and starter code as they were given to students, if you no longer have them.
- The specific policy provision you are accused of violating, and the procedure that applies.
You will often not be given the other student's identity, and some schools will only let you view materials rather than receive copies. That is common. Ask for what you need to respond, and keep your request focused and calm.
What evidence helps show you wrote your own code?
In short:The strongest evidence shows your code being built over time, in your own way, before the other submission existed or without access to it.
The strongest evidence shows your code being built over time, in your own way, before the other submission existed or without access to it. Version history, local IDE history and timestamps often matter more than anything you say in the meeting.
Start gathering and preserving now, before anything is overwritten:
- Git commit history. If you used git, your commit log shows when each change was made and what it was. Frequent, incremental commits with messages are very persuasive. Do not rewrite, squash or delete history now, even to tidy it up.
- IDE local history. Many editors keep a local history of file changes, even without git. VS Code's Timeline view, JetBrains IDEs' Local History and similar features can show your edits over time. This history can expire, so export or screenshot it soon.
- File timestamps and backups. Cloud sync services, Time Machine and similar backups may hold earlier versions of your files.
- Drafts and abandoned attempts. Earlier broken versions, debugging print statements and approaches you tried and dropped show real problem solving.
- Submission logs. Gradescope and other autograders often record each submission attempt, with times and test results. A history of failing and then passing tests can show your progression.
- Office hours and help records. Notes, queue tickets, TA emails or forum posts where you asked questions about your own code.
- Notes and planning. Pseudocode, sketches, whiteboard photos or notes from lecture.
- AI assistant logs, if AI use was permitted and you used it, showing what you asked and what it suggested.
Do not create, edit or backdate anything. Fabricated or altered evidence is usually treated as a separate and more serious violation, and version history is easy to check.
How do you explain your coding process in a meeting?
In short:Explain your code the way you would to a TA at office hours: walk through what each part does, why you wrote it that way, what went wrong along the way and how you fixed it.
Explain your code the way you would to a TA at office hours: walk through what each part does, why you wrote it that way, what went wrong along the way and how you fixed it. Being able to explain your own work fluently is often the most convincing thing a student can do.
Practical preparation:
- Reread your code and the matched regions. Be ready to explain every highlighted section, including why it looks the way it does.
- Identify the innocent source of each match. For each highlighted block, note whether it came from starter code, the spec, lecture, documentation or a permitted source. Bring the lecture slide or documentation if you have it.
- Bring your timeline. A one page summary of when you started, key commits, office hours visits and submission attempts helps the reviewer follow along.
- Offer to demonstrate. Some students offer to write a similar function on the spot, modify their code live or answer questions about design choices. Only offer what you are comfortable doing calmly.
- Be honest about collaboration. If you discussed the problem with the other student, say so, explain at what level, and point to the policy language that allowed it. Volunteering an accurate account usually goes better than having it come out later.
- Stay factual. Avoid accusing the other student or attacking the tool. "Here is where this section came from" is more effective than "MOSS is unreliable."
If you did share code, or looked at someone else's, the meeting is still important. Policies often treat sharing and copying differently, and sanctions frequently depend on candor, context and whether this is a first issue. Our guide on what integrity panels look for covers how decision makers tend to weigh explanations.
Should you accept the instructor's proposed resolution?
In short:Read the proposed resolution carefully before you agree, because in many schools accepting an instructor resolution counts as admitting the violation and may create a record with the integrity office.
Read the proposed resolution carefully before you agree, because in many schools accepting an instructor resolution counts as admitting the violation and may create a record with the integrity office. If you did not copy, you can often decline and ask for the matter to go through the formal process, where the evidence is actually weighed.
Before deciding, find out exactly what you would be admitting, what the penalty is, whether it is reported centrally and whether it could affect scholarships, TA positions or graduate applications. Our comparison of formal hearings and informal resolution explains the tradeoffs.
What if both students are accused?
In short:When two submissions match, many schools open a case against both students, because the tool cannot tell who wrote the code first or whether one person shared with the other.
When two submissions match, many schools open a case against both students, because the tool cannot tell who wrote the code first or whether one person shared with the other. Each student usually has their own case, their own meeting and their own outcome.
If you are one of the pair, focus on your own process and evidence. Do not contact the other student to coordinate stories or ask them to say anything, since that can look like interference even if your intentions are good. If you are friends and talk about it, keep it to logistics and avoid discussing what each of you will say. If you shared code in a way you did not realize was prohibited, for example by posting it publicly, explain that honestly.
Can MOSS results alone prove plagiarism?
In short:Usually not. Stanford's MOSS page describes the scores as not proof of plagiarism and says a person must review the code.
Usually not. Stanford's MOSS page describes the scores as not proof of plagiarism and says a person must review the code. Most schools still have to show a violation under their own standard of proof, often "more likely than not," so the reviewer's analysis of the matched code and the surrounding facts is what matters. Our guide on what a school must prove explains these standards.
Does using Stack Overflow count as plagiarism?
In short:It depends on your course policy. Some courses allow short snippets from public sources with a citation in a comment, some allow them without citation, and some prohibit them entirely.
It depends on your course policy. Some courses allow short snippets from public sources with a citation in a comment, some allow them without citation, and some prohibit them entirely. If you used a snippet, say so plainly and show where it came from.
Can using GitHub Copilot or ChatGPT trigger a code similarity match?
In short:Yes, it can. AI coding assistants often suggest similar code to different students working on the same problem, so their output can produce matches between students who never shared anything.
Yes, it can. AI coding assistants often suggest similar code to different students working on the same problem, so their output can produce matches between students who never shared anything. Whether that helps you depends on whether your course allowed the tool for that assignment.
What if my code was in a public GitHub repository?
In short:Many courses prohibit posting solutions publicly, and if another student copied from your public repository, some policies treat that as facilitating misconduct.
Many courses prohibit posting solutions publicly, and if another student copied from your public repository, some policies treat that as facilitating misconduct. Explain when and why you posted it, whether you knew the rule, and take it down or make it private if the course asks you to.
Getting Help From AdvocatED
In short:Code similarity cases often come down to whether your evidence is organized clearly and whether you can explain your own work calmly under questioning.
Code similarity cases often come down to whether your evidence is organized clearly and whether you can explain your own work calmly under questioning. AdvocatED's education advisors help students read the course and school policy, organize evidence such as commit history and submission logs, prepare written responses, prepare for meetings and hearings, and write appeals through our academic misconduct advising. We are not a law firm and do not provide legal representation.
If you have received a MOSS or code similarity notice, you can start with a free case review.
Frequently Asked Questions
What does a MOSS code plagiarism flag actually mean?
A MOSS flag means a program found unusually similar structure between your code and another submission, and a person in the course decided the match was worth a closer look. It is not a finding that you copied anything. Stanford's own MOSS page says the similarity scores are not proof of plagiarism, that someone must still look at the code, and that relying solely on the scores is a misuse of the tool.
How do MOSS and other code similarity tools work?
Code similarity tools compare submissions to each other and highlight regions where the structure of the code lines up, then produce a ranked list of the most similar pairs. They are built to catch copying that has been disguised, so they usually look past surface changes such as renamed variables, different comments, reordered whitespace or reformatted lines.
Why does similar code happen innocently?
Innocent similarity is common in programming because many assignments are small, tightly specified and taught with the same examples, so a large share of correct solutions end up looking alike. The tighter the specification, the fewer reasonable ways there are to write it.
What does your course collaboration policy actually allow?
Your course collaboration policy, usually in the syllabus or on the course website, defines what kind of help and sharing is allowed, and the case will usually turn on whether what happened fits inside or outside those lines. Computer science courses vary widely, so read your specific policy word for word rather than assuming.
What should you request after a code similarity accusation?
Ask, in writing, for the specific evidence the accusation is based on so you can respond to it directly. A short, polite email to the instructor or integrity office is usually enough.
What evidence helps show you wrote your own code?
The strongest evidence shows your code being built over time, in your own way, before the other submission existed or without access to it. Version history, local IDE history and timestamps often matter more than anything you say in the meeting.
Related Articles
Flagged by Proctorio, Honorlock or Respondus? What a Proctoring Flag Means and How to Respond
Read →Academic MisconductAccused of Using Chegg, Course Hero or Quizlet? How These Cases Work and How to Respond
Read →Academic MisconductAccused of Using AI to Write Your Paper? Here's How to Defend Yourself
Read →Academic MisconductTurnitin Similarity Score: What Percentage Is Actually Plagiarism?
Read →Academic MisconductAccused of Self-Plagiarism? Reusing Your Own Work, Duplicate Submission and How to Respond
Read →Academic MisconductAccused of Cheating Through a Group Chat? GroupMe, Discord, WhatsApp and Snapchat Collaboration Cases
Read →More on Academic Misconduct
- →Falsely Accused of Cheating? What the School Has to Prove and How to Respond
- →College Board Canceled or Held Your Score? How the Appeal and Reconsideration Process Works
- →What Actually Counts as Plagiarism? Understanding Academic Integrity Policies
- →Accused of Cheating After an Accommodation Was Denied? What Students With Disabilities Should Know
- →Can an Academic Misconduct Finding Be Expunged From Your Record?
- →Can a College Revoke Your Degree for Plagiarism or AI Use? How Degree Revocation Works
- →Accused of Cheating at Ohio State? What to Do About a COAM Hearing
- →Should I Hire a Student Defense Attorney for a Cheating Accusation?
Need Help With Your Specific Situation?
AdvocatED provides free case reviews. Tell us what you're facing and we'll give you an honest assessment.
Flat fees, published up front: Academic Misconduct Defense starting at $2,500. See all pricing