About this C# comparison
Whether you are comparing two versions of a class, checking an auto-generated file after a tool upgrade, or reviewing a change without opening Visual Studio, a C# diff shows exactly which members and statements changed.
C# syntax colours keep keywords, strings and types easy to read, with the changes marked on top.
What changed in this sample
num1,num2andsumbecamea,bandresult, set to 12 and 18.- The
Console.WriteLinelabel changed from “Sum” to “Result”. - The
ifthreshold went from 15 to 20, and both messages changed with it.
Tips for comparing C#
- Compare generated code
- Designer files and generated clients change in bulk. Fold unchanged keeps the result short, and the arrows jump between changes.
- Ignore CRLF
- Files from Windows use CRLF line endings. Those are never counted as changes, and a note tells you when the two files differ.
- Compare project files too
- .csproj and app.config files are XML; opening them switches the highlighting to XML.
- Undo a replacement
- Opening a file over existing text shows an Undo button, so you never lose what was in the pane.
How to compare C# online
- Paste the older version into Original and the newer one into Changed, or open a file on each side.
- Check that the syntax menu says C#, then pick split or unified view.
- Step through the changes with the arrows or Alt ↓, and use Settings for options such as ignoring blank lines.
- Save the comparison in your browser, share a link, or download it as a .diff, HTML or PDF.
C# comparison: questions
Can I compare two .cs files?
Yes. Open or drop them onto the panes and C# highlighting is chosen from the extension.
Is my code uploaded?
No. The comparison runs in your browser. Code only leaves your machine if you create a share link.
Can I compare VB.NET as well?
Yes. VB.NET is in the syntax menu, and the VBScript sample shows a VB-style program.