Copy/Paste Detector for Source Code

jscpd v5 is a Rust-powered rewrite that hunts down duplicated blocks across 223+ languages up to 37x faster than v4 — because life's too short to maintain the same bug in five different places. Need the Node.js API? v4 is still available. AI-ready with the --reporters ai flag.
Terminal
$curl -fsSL https://jscpd.dev/install.sh | bash
// Your code deserves better than copy/paste chaos
$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. Now rewritten in Rust for native performance — no Node.js runtime required.
    Speaks 223+ Languages

    JavaScript, Python, Java, Go, Rust, C++, TypeScript, Ruby... If you can write it, we can scan it. Vue, Svelte, Astro, and Markdown cross-format detection too.

    View supported formats
    20M+ Downloads
    One of the most trusted tools in the ecosystem. Join developers who rely on jscpd every day.
    Blazingly Fast™

    Rewritten in Rust. 24-37x faster than the TypeScript engine. 159 MB codebase? 3.4 seconds. No Node.js runtime — just a single native binary.

    See benchmarks
    CLI-First Design

    One command to rule them all. Works everywhere — your laptop, CI/CD, that ancient Jenkins server nobody wants to touch.

    Get started
    Beautiful Reports

    HTML, JSON, XML, badges for your README. Make technical debt visible (and slightly embarrassing).

    Explore reporters
    Programmable

    v5: Rust crate API. v4: Node.js API. Same CLI in both. Use whichever fits your stack.

    View API documentation
    CI/CD Ready

    Set a threshold, fail the build, save the day. Your future self will thank you.

    Configure thresholds
    MCP Server New

    Let AI assistants like Claude check your code for duplications directly using the Model Context Protocol.

    Learn about MCP Server
    Cross-Format Detection New
    Vue SFC, Svelte, Astro, and Markdown files are tokenized per-block — a <script> in .vue can match a .ts file. Detect duplication across file types.
    AI Reporter New

    Compact output that saves ~79% of tokens compared to the default reporter — ideal for piping into LLMs.

    AI Reporter docs
    Agent Skill New

    Install a skill for your AI coding assistant to automatically detect and refactor duplications — one command to get started.

    npx skills add kucherenko/jscpd
    
    Learn more

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: 13ms

v5 vs v4: Performance

The Rust engine makes jscpd 24–37x faster across every codebase size.
TargetFilesSizev4 (TypeScript)v5 (Rust)Speedup
fixtures5481.5 MB1.03s0.03s34.3x
Svelte8,96338 MB15.80s0.43s36.9x
CopilotKit17,092159 MB82.89s3.44s24.1x

Git blame is 27.5x faster with v5's in-process gitoxide (0.13s vs 3.57s on fixtures).

Benchmarked on macOS (Apple Silicon). See the Migration Guide for full details.

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