Supported Formats
Overview
jscpd supports 223 programming languages and document formats for duplication detection.
130 formats are auto-detected by file extension. 88 registered formats have a grammar but no built-in extension mapping — use --formats-exts or --formats-names to activate them. An additional 5 formats (clike, comments, hpkp, hsts, keymap) are internal grammar dependencies.
Cross-Format Tokenizers
These formats use bespoke multi-block tokenizers that extract embedded code sections and resolve each block to the correct sub-format, enabling cross-format duplicate detection — e.g. a <script> block in a .vue file matched against .ts files.
| Format | Extensions | Description |
|---|---|---|
| astro | .astro | Astro component format (frontmatter + template) |
| svelte | .svelte | Svelte reactive component framework |
| vue | .vue | Vue Single-File Component (template, script, style blocks) |
| markdown | .md, .markdown, .mkd | Markdown with fenced code blocks tokenized by language |
Auto-Detected Formats
These formats are detected automatically by file extension — no extra flags needed.
General-Purpose Languages
| Format | Extensions | Description |
|---|---|---|
| actionscript | .as | Adobe ActionScript |
| ada | .ada | Ada, strongly-typed systems language |
| antlr4 | .g4 | ANTLR v4 grammar definitions |
| apex | .cls, .trigger, .apex | Salesforce Apex |
| apl | .apl | APL, array-oriented language |
| aspnet | .asp, .aspx | ASP.NET server-side files |
| awk | .awk | AWK text-processing |
| bash | .sh, .ksh, .bash | Bash and POSIX shell scripts |
| basic | .bas | BASIC |
| bicep | .bicep | Azure Bicep infrastructure-as-code |
| brainfuck | .b, .bf | Brainfuck esoteric language |
| c | .c, .z80 | C programming language |
| c-header | .h | C header files |
| cfml | .cfm | ColdFusion Markup Language |
| cfscript | .cfc | ColdFusion components (CFScript) |
| clojure | .clj, .cljs, .cljc, .cljx, .edn | Clojure |
| cmake | .cmake | CMake build scripts |
| coffeescript | .coffee | CoffeeScript |
| cpp | .cpp, .c++, .cc, .cxx | C++ |
| cpp-header | .hpp, .h++, .hh, .hxx | C++ header files |
| crystal | .cr | Crystal |
| csharp | .cs | C# |
| csv | .csv | CSV data files |
| css | .css, .gss | CSS |
| d | .d | D systems language |
| dart | .dart | Dart / Flutter |
| diff | .diff, .patch | Unified diff and patch files |
| dot | .dot, .gv | Graphviz DOT |
| eiffel | .e | Eiffel |
| elm | .elm | Elm web language |
| erlang | .erl, .erlang | Erlang |
| excel-formula | .xlsx, .xls | Microsoft Excel |
| fortran | .f, .for, .f77, .f90 | Fortran |
| fsharp | .fs | F# |
| gdscript | .gd | GDScript for Godot |
| gettext | .po | GNU gettext PO files |
| gherkin | .feature | Gherkin BDD scenarios |
| go | .go | Go |
| graphql | .graphql | GraphQL |
| groovy | .groovy, .gradle | Groovy / Gradle |
| haml | .haml | Haml templates |
| handlebars | .hb, .hbs, .handlebars | Handlebars templates |
| haskell | .hs, .lhs | Haskell |
| haxe | .hx, .hxml | Haxe |
| hcl | .tf, .hcl | HashiCorp HCL (Terraform) |
| idris | .idr | Idris |
| ignore | .gitignore | Gitignore files |
| ini | .ini | INI configuration |
| java | .java | Java |
| javascript | .js, .es, .es6, .mjs, .cjs | JavaScript |
| json | .json, .map, .jsonld | JSON |
| json5 | .json5 | JSON5 |
| jsx | .jsx | JSX (React) |
| julia | .jl | Julia |
| kotlin | .kt, .kts | Kotlin |
| latex | .tex | LaTeX |
| less | .less | Less CSS preprocessor |
| lilypond | .ly | LilyPond music notation |
| linker-script | .ld | GNU linker scripts |
| lisp | .cl, .lisp, .el | Common Lisp / Emacs Lisp |
| livescript | .ls | LiveScript |
| llvm | .ll | LLVM IR |
| log | .log | Log files |
| lua | .lua | Lua |
| markup | .html, .htm, .xml, .xsl, .xslt, .svg, .ejs, .jsp | HTML, XML, SVG |
| nsis | .nsh, .nsi | NSIS installer scripts |
| objectivec | .m, .mm | Objective-C |
| ocaml | .ocaml, .ml, .mli, .mll, .mly | OCaml |
| openqasm | .qasm | OpenQASM quantum assembly |
| oz | .oz | Oz/Mozart |
| pascal | .pas, .p | Pascal |
| perl | .pl, .pm | Perl |
| php | .php, .phtml | PHP |
| plant-uml | .puml, .plantuml | PlantUML diagrams |
| plsql | .plsql | PL/SQL |
| powerquery | .pq | Power Query M |
| powershell | .ps1, .psd1, .psm1 | PowerShell |
| properties | .properties | Java properties |
| protobuf | .proto | Protocol Buffers |
| pug | .pug, .jade | Pug (Jade) templates |
| puppet | .pp, .puppet | Puppet |
| purescript | .purs | PureScript |
| python | .py, .pyx, .pxd, .pxi | Python |
| q | .q | Q/kdb+ |
| qsharp | .qs | Q# quantum |
| r | .r, .R | R |
| racket | .rkt | Racket |
| rescript | .res | ReScript |
| robotframework | .robot | Robot Framework |
| ruby | .rb | Ruby |
| rust | .rs | Rust |
| sas | .sas | SAS |
| sass | .sass | Sass (indented syntax) |
| scala | .scala | Scala |
| scheme | .scm, .ss | Scheme |
| scss | .scss | SCSS |
| smalltalk | .st | Smalltalk |
| smarty | .smarty, .tpl | Smarty templates |
| solidity | .sol | Solidity (Ethereum) |
| soy | .soy | Google Closure Templates |
| sparql | .rq | SPARQL |
| sql | .sql, .cql | SQL |
| stylus | .styl, .stylus | Stylus |
| swift | .swift | Swift |
| tap | .tap | TAP (Test Anything Protocol) |
| tcl | .tcl | Tcl |
| textile | .textile | Textile markup |
| toml | .toml | TOML configuration |
| tsx | .tsx | TSX (React + TypeScript) |
| tt2 | .tt2 | Template Toolkit 2 |
| turtle | .ttl | Turtle (RDF) |
| twig | .twig | Twig templates |
| typescript | .ts, .mts, .cts | TypeScript |
| txt | .txt | Plain text |
| unrealscript | .uc | UnrealScript |
| vbnet | .vb | Visual Basic .NET |
| velocity | .vtl | Apache Velocity |
| verilog | .v | Verilog (hardware) |
| vhdl | .vhd, .vhdl | VHDL |
| wgsl | .wgsl | WebGPU Shading Language |
| wolfram | .wl, .nb | Wolfram Language |
| xquery | .xy, .xquery | XQuery |
| yaml | .yaml, .yml | YAML |
| zig | .zig | Zig |
Registered Formats (No Extension Mapping)
These formats have a working grammar but no built-in file extension mapping. Use --formats-exts to associate extensions, or --formats-names for extensionless files.
# Example: enable ABAP detection for .abap files
jscpd --formats-exts "abap:abap" ./src
# Example: detect Dockerfiles by name
jscpd --formats-names "docker:Dockerfile" ./src
| Format | Install command |
|---|---|
| abap | --formats-exts "abap:abap" |
| apacheconf | --formats-exts "apacheconf:conf" |
| applescript | --formats-exts "applescript:applescript,scpt" |
| arduino | --formats-exts "arduino:ino" |
| arff | --formats-exts "arff:arff" |
| asciidoc | --formats-exts "asciidoc:adoc,asciidoc" |
| asm6502 | --formats-exts "asm6502:s,asm" |
| autohotkey | --formats-exts "autohotkey:ahk" |
| autoit | --formats-exts "autoit:au3" |
| batch | --formats-exts "batch:bat,cmd" |
| bison | --formats-exts "bison:y,yy" |
| bro | --formats-exts "bro:bro,zeek" |
| csp | --formats-exts "csp:csp" |
| css-extras | --formats-exts "css-extras:css" |
| django | --formats-exts "django:html,djhtml" |
| docker | --formats-names "docker:Dockerfile" or --formats-exts "docker:dockerfile" |
| elixir | --formats-exts "elixir:ex,exs" |
| erb | --formats-exts "erb:erb" |
| flow | --formats-exts "flow:js" |
| gdscript | --formats-exts "gdscript:gd" (also auto-detected by .gd) |
| gedcom | --formats-exts "gedcom:ged" |
| git | --formats-exts "git:gitconfig" |
| glsl | --formats-exts "glsl:glsl,vert,frag" |
| http | --formats-exts "http:http" |
| ichigojam | --formats-exts "ichigojam:bas" |
| icon | --formats-exts "icon:icn" |
| inform7 | --formats-exts "inform7:ni,i7x" |
| io | --formats-exts "io:io" |
| j | --formats-exts "j:ijs" |
| jolie | --formats-exts "jolie:ol,iol" |
| liquid | --formats-exts "liquid:liquid" |
| lolcode | --formats-exts "lolcode:lol" |
| makefile | --formats-names "makefile:Makefile,GNUmakefile" |
| matlab | --formats-exts "matlab:m" |
| mel | --formats-exts "mel:mel" |
| mizar | --formats-exts "mizar:miz" |
| monkey | --formats-exts "monkey:monkey" |
| n4js | --formats-exts "n4js:n4js" |
| nasm | --formats-exts "nasm:asm,nasm" |
| nginx | --formats-exts "nginx:conf,nginx" |
| nim | --formats-exts "nim:nim" |
| nix | --formats-exts "nix:nix" |
| opencl | --formats-exts "opencl:cl" |
| parigp | --formats-exts "parigp:gp" |
| processing | --formats-exts "processing:pde" |
| prolog | --formats-exts "prolog:pl,pro" |
| promql | --formats-exts "promql:promql" |
| pure | --formats-exts "pure:pure" |
| qore | --formats-exts "qore:q,qm" |
| reason | --formats-exts "reason:re,rei" |
| renpy | --formats-exts "renpy:rpy" |
| rest | --formats-exts "rest:rst" |
| rip | --formats-exts "rip:rip" |
| roboconf | --formats-exts "roboconf:graph,instances" |
| vim | --formats-exts "vim:vim" |
| wasm | --formats-exts "wasm:wat" |
| wiki | --formats-exts "wiki:wiki" |
| xeora | --formats-exts "xeora:xeora,xchtml" |
| xojo | --formats-exts "xojo:xojo_code,xojo_window" |
Extension Detection Only (No Grammar)
These formats register file extensions for detection but have no bundled grammar — tokenization returns an empty array. They still benefit from jscpd's blank-line and structural matching.
| Format | Install command |
|---|---|
| abnf | --formats-exts "abnf:abnf" |
| agda | --formats-exts "agda:agda" |
| aql | --formats-exts "aql:aql" |
| armasm | --formats-exts "armasm:s,asm" |
| bnf | --formats-exts "bnf:bnf" |
| cobol | --formats-exts "cobol:cob,cbl" |
| cypher | --formats-exts "cypher:cypher,cql" |
| dhall | --formats-exts "dhall:dhall" |
| dns-zone-file | --formats-exts "dns-zone-file:zone" |
| ebnf | --formats-exts "ebnf:ebnf" |
| editorconfig | --formats-exts "editorconfig:editorconfig" |
| factor | --formats-exts "factor:factor" |
| ftl | --formats-exts "ftl:ftl" |
| gcode | --formats-exts "gcode:gcode,nc" |
| gml | --formats-exts "gml:gml" |
| go-module | --formats-names "go-module:go.mod" |
| hlsl | --formats-exts "hlsl:hlsl,hlsli" |
| jq | --formats-exts "jq:jq" |
| kusto | --formats-exts "kusto:kql" |
| mermaid | --formats-exts "mermaid:mmd" |
| mongodb | --formats-exts "mongodb:mongo" |
| n1ql | --formats-exts "n1ql:n1ql" |
| odin | --formats-exts "odin:odin" |
| regex | --formats-exts "regex:regex" |
| rego | --formats-exts "rego:rego" |
| shell-session | --formats-exts "shell-session:sh-session,console" |
| smali | --formats-exts "smali:smali" |
| stata | --formats-exts "stata:do,ado" |
| typoscript | --formats-exts "typoscript:typoscript,tsconfig" |
| vala | --formats-exts "vala:vala,vapi" |
Shebang Detection
jscpd can detect duplications in script files that have no file extension by reading the #! shebang line:
| Interpreter | Detected as |
|---|---|
bash, sh, zsh, fish, dash, ksh | bash |
python, python3, python2 | python |
node, nodejs | javascript |
ruby | ruby |
perl | perl |
php | php |
lua | lua |
tclsh, wish | tcl |
Rscript | r |
groovy | groovy |
swift | swift |
kotlin | kotlin |
Custom Format Extensions
Associate custom file extensions with a format:
jscpd --formats-exts "javascript:js,es6,vue" ./src
Or in configuration:
{
"formatsExts": {
"javascript": ["js", "es6", "vue"]
}
}
Custom Filename Mapping
Map extensionless files to a format by filename:
jscpd --formats-names "makefile:Makefile,GNUmakefile;docker:Dockerfile" ./src
Or in configuration:
{
"formatsNames": {
"makefile": ["Makefile", "GNUmakefile"],
"docker": ["Dockerfile"]
}
}
View Full List
You can also view the full list of supported formats by running:
jscpd --list