Paste two versions of TypeScript code, or drop .ts, .tsx, .mts and .cts files, to see every change highlighted. Use it to review type changes in an interface, compare generated declaration files, or check a refactor before pushing. Diffspot highlights TypeScript syntax, marks changed words inside each line and recognizes moved blocks. Press Try an example to see it on a real TypeScript change.
How to compare TypeScript files
- Paste or drop the original TypeScript code on the left.
- Paste or drop the changed version on the right. The diff updates as you type.
- Jump between changes with F7 and Shift+F7, or switch to Unified view to read it like a pull request.
- Copy or export a unified diff, a .patch file or an HTML report.
TypeScript comparison tips
- Comparing TypeScriptGenerics, type annotations and decorators are highlighted, so changes to types stand out from changes to logic.
- Cut the noiseComparing two versions of a generated .d.ts file? Turn on Collapse unchanged lines to see only the changed declarations.
- Your code stays privateThe comparison runs on your device in WebAssembly. Proprietary code is never uploaded or stored.
- Fast on large filesFiles with hundreds of thousands of lines compare in about a second.
Frequently asked questions
Is TypeScript detected automatically?
Yes. Diffspot recognizes TypeScript from the file name (.ts, .tsx, .mts and .cts) or from the code itself. You can also choose it in the Syntax menu.
Is my code uploaded?
No. The page loads the diff engine once; after that your code stays in the browser tab. How Diffspot works explains how you can check this yourself.
Can I get a patch file?
Yes. Export → Download .patch creates a standard unified diff that git apply or patch can apply.