If you get the source code of a program from a student, is there any good automatic way to check if the code is copied somewhere from the web?

I.e. is there a search engine specialized on source code where I can put in a larger part of the code and it crawls the web for code fragments that look similar?

I know that there are only plagiarism detectors for texts such as https://www.quetext.com/ and specialized tools for source code that match one file to another file, but I don't know any tool that checks a source code file against every source code found online.

  • I think Black Duck is sort of an industry standard for plagiarism detection. Never used it personally, though. Dec 13, 2022 at 8:22

4 Answers 4


I only read about it and therefore i have no experience with the tool, but you could try MOSS.



Most education systems, (such as moodle) will have this sort of functionality built in to the educators side of the interface.

It works great for word type submissions but for code it is a bit more difficult as code chunks are pretty similar in operation and structure and you will see multiple hits on each chunk.

This is because coding is often more about functionality rather than authoring and getting chunks from the net is a standard practise when learning/teaching.

As Markus identified the MOSS tool is closer to the type of tool you are looking for but even in its own What is Moss Not? section of their documentation it identifies the issues with using a tool in isolation.

Moss is not a system for completely automatically detecting plagiarism. Plagiarism is a statement that someone copied code deliberately without attribution, and while Moss automatically detects program similarity, it has no way of knowing why codes are similar. It is still up to a human to go and look at the parts of the code that Moss highlights and make a decision about whether there is plagiarism or not...

At uni we were encouraged to seek to out pre-existing code to incorporate as long as the chunk was identified and attributed to the author, (we had to have the links to the chunks detailed within our comments), there was also a percentage of attributed chunks that we could use, (i think it was something around 35%). The real trick was in the student explaining why each chuck worked and how it could be minimised or improved to better suit the desired outcome.

Checking if code has just been copy pasted between students was more of an issue, but you will find those sort of issues are pretty easy to spot because you will see the exact same layout, structure and even the same naming of functions and variables.

Often the best way to check is to have the students add detailed comments to each chunk as these are often more personal as most students have vernacular or cadence that is more apparent. This coupled with peer reviews and assessment is the best way to identify plagiarism in coding.

Not the best answer for you but hopefully it works out for your situation.


You can look at the Computer Code Originality Checker http://codep.lab.p1k.org
As for now, it works with Python code and only with the uploaded files but they promise to add web search function soon.
P. S. As far as I know, it is on the stage of closed beta test, so registration is required
Registration form: https://docs.google.com/forms/d/e/1FAIpQLSfa0dgcWBp70NHFwKk44H5QwpA8Appjwj4eZ7GO5YW62xy7Lw/viewform?usp=sf_link


there is a tool for this purpose AppRefactoring - it checks the code for uniqueness in the code base

  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Feb 7, 2023 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.