Compare code by language
Diffspot detects the language of what you paste and highlights it. Each page below opens the diff checker preset for one language, with a real example.
Programming and markup languages
- JavaScript.js, .jsx, .mjs and .cjs
- TypeScript.ts, .tsx, .mts and .cts
- Python.py and .pyi
- Java.java
- C#.cs and .csx
- C.c and .h
- C++.cpp, .cc, .hpp and .h
- Go.go
- Rust.rs
- PHP.php
- Ruby.rb, .rake, Gemfile and Rakefile
- Swift.swift
- Kotlin.kt and .kts
- Scala.scala, .sc and .sbt
- Dart.dart
- SQL.sql
- HTML.html and .htm
- CSS.css, .scss and .less
- Markdown.md and .mdx
- Shell.sh, .bash, .zsh and dotfiles like .bashrc
- PowerShell.ps1, .psm1 and .psd1
- DockerfileDockerfile and Containerfile
- MakefileMakefile, GNUmakefile and .mk
- Lua.lua
- Perl.pl and .pm
- R.r and .Rmd
- Elixir.ex and .exs
- Haskell.hs and .lhs
- Objective-C.m, .mm and .h
- GraphQL.graphql and .gql
- Protocol Buffers.proto
- Terraform (HCL).tf, .tfvars and .hcl
- Groovy / Gradle.groovy, .gradle and Jenkinsfile
- Vue.vue
- Svelte.svelte
- INI and .env.ini, .cfg, .conf, .properties and .env
Data and configuration formats
Data formats get a structural comparison: formatting and key order are normalized first, and every change is listed by path.
How language detection works
When you open a file, Diffspot looks at its name and extension first (Dockerfile, .tsx, Cargo.lock). For pasted text it scores characteristic patterns, such as def and indentation for Python, <?php for PHP or SELECT … FROM for SQL, and picks the best match from both sides together. Detection and highlighting run in a Rust engine compiled to WebAssembly, so they take a few milliseconds even for large files, and nothing is uploaded.
If the guess is wrong, choose the language from the Syntax menu in the toolbar.