Introduction
Welcome to jscpd, a powerful copy/paste detector for programming source code that supports 223+ languages and formats.
Two Versions
jscpd is available in two major versions:
| v5 (Rust) | v4 (TypeScript) | |
|---|---|---|
| Install | npm install -g jscpd@5 | npm install -g jscpd@4 |
| Speed | 24-37x faster | Baseline |
| Runtime | Self-contained binary (no Node.js) | Requires Node.js |
| API | Rust crates (cpd-finder, cpd-core) | Node.js (import { jscpd } from 'jscpd') |
| Support | Active development | Maintenance |
Use v5 for the fastest detection. Use v4 if you need the Node.js programmatic API. Both can coexist — see the Migration Guide.
What is jscpd?
jscpd is a tool that helps you find duplicated blocks in programming source code. Copy/paste is a common source of technical debt in software projects, and jscpd helps you identify and eliminate these duplications.
The tool uses the Rabin-Karp rolling hash algorithm for efficient searching of duplications across large codebases. In v5, the engine is implemented in Rust; in v4, it runs on Node.js.
What's New in v5
jscpd v5 is a complete Rust rewrite — a self-contained native binary that's 24-37x faster than the TypeScript engine, with no Node.js runtime required. It also introduces 13 reporters, OXC-based JS/TS tokenization, and parallel detection across format groups.
See the Changelog for the full release history, or the Migration Guide for upgrading from v4.
Key Features
223+ Languages
Blazingly Fast (v5)
CLI-First + Rust API
13 Reporters
AI-Ready
ai reporter saves ~79% tokens. MCP server for AI assistants. Agent skill for automatic refactoring.Cross-Format Detection
<script> in .vue matches .ts files.Packages
v5 (Rust)
| Package | Description |
|---|---|
| jscpd | Main binary — npm install -g jscpd@5 or cargo install jscpd |
| cpd | Lightweight alias — same binary, shorter command |
| jscpd-server | Standalone server (REST API + MCP) — still Node.js based |
| cpd-core | Rust crate — core detection algorithm |
| cpd-tokenizer | Rust crate — source code tokenizer |
| cpd-finder | Rust crate — file walking, orchestration, git blame |
| cpd-reporter | Rust crate — 13 output reporters |
v4 (TypeScript) — Maintenance
| Package | Description |
|---|---|
| jscpd@4 | CLI + Node.js API (import { jscpd } from 'jscpd') |
| jscpd-server | Standalone server (REST API + MCP) |
| @jscpd/core | Core detection algorithm |
| @jscpd/finder | File duplication detector |
| @jscpd/tokenizer | Source code tokenizer |
| @jscpd/html-reporter | HTML report generator |
| @jscpd/badge-reporter | Badge generator |
| @jscpd/sarif-reporter | SARIF reporter |
| @jscpd/leveldb-store | LevelDB store for big codebases |
Quick Example
# v5 — install Rust binary (recommended)
npm install -g jscpd@5
# v5 — or via cargo
cargo install jscpd
# v4 — install TypeScript version
npm install -g jscpd@4
# Both versions use the same CLI
jscpd /path/to/source
Ready to get started? Head to the Installation guide or the Migration Guide if you're upgrading from v4.