Copy/Paste Detector for Source Code

jscpd hunts down duplicated blocks across 150+ languages — because life's too short to maintain the same bug in five different places.
Terminal
// Your code deserves better than copy/paste chaos
$ npx jscpd ./src
→ Finding duplicates...
✓ Scan complete: 3 clones found
🚀

Why Developers Love jscpd

Because clean code is happy code
    Since 2013
    A decade of refining the art of duplicate detection. Tried, tested, and trusted by thousands of teams worldwide.
    Speaks 150+ Languages
    JavaScript, Python, Java, Go, Rust, C++, TypeScript, Ruby... If you can write it, we can scan it. Even your YAML configs aren't safe.
    20M+ Downloads
    One of the most trusted tools in the ecosystem. Join developers who rely on jscpd every day.
    Blazingly Fast™
    Powered by the Rabin-Karp algorithm. Scans massive codebases before your coffee gets cold.
    CLI-First Design
    One command to rule them all. Works everywhere — your laptop, CI/CD, that ancient Jenkins server nobody wants to touch.
    Beautiful Reports
    HTML, JSON, XML, badges for your README. Make technical debt visible (and slightly embarrassing).
    Programmable
    Full API for Node.js. Build your own duplicate-detection empire. We won't judge.
    CI/CD Ready
    Set a threshold, fail the build, save the day. Your future self will thank you.

See It In Action

From chaos to clarity in seconds
# Scan your source code
$ jscpd ./src

Clone found (typescript):
 - src/utils.ts [10:1 - 25:3] (15 lines, 129 tokens)
   src/helpers.ts [5:1 - 20:3]

Clone found (typescript):
 - src/utils.ts [45:5 - 62:2] (17 lines, 178 tokens)
   src/components/Button.tsx [12:1 - 29:2]

Clone found (javascript):
 - src/hooks/useAuth.ts [1:1 - 34:2] (33 lines, 245 tokens)
   src/hooks/useSession.ts [1:1 - 34:2]

# ... more clones

Found 90 clones.
Detection time: 434.777ms

Built by a Human Who Gets It

Created with ❤️ by Andrey Kucherenko

Andrey Kucherenko believes that every copy-pasted code block is a bug waiting to happen twice. He built jscpd so you don't have to fix the same issue in five files.

💙 Huge Thank You to Our Contributors!

This project wouldn't exist without you

To everyone who has contributed to jscpd — thank you! 🌟

Whether you've submitted code, reported bugs, suggested features, improved documentation, or simply spread the word — your contributions make jscpd better for everyone. We're grateful for every issue closed, every PR merged, and every kind word shared.

With a grateful heart, 🤗

The jscpd Team

View Contributors