The Best .NET Decompiler Comparison Guide ✅ (Free and Paid)
Tags: csharp, dotnet, beginners, tutorial
Published: 2022-07-05 11:31:00

Decompiling .NET assemblies is an invaluable skill for any software developer or security engineer who wants to reverse engineer or disassemble someone else’s code, and there are several tools available to help you do this, each with its own unique features and quirks. This guide will compare the features of the most popular decompilers to help you figure out which one is right for you.

## What is decompilation in .NET?

For everyone for understand what the decompilation process in .NET is, you must first understand the concept of compilation.

### Undestanding what is compilation .NET

In software development, [C# is a high-level programming language](https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/). Compilation in .NET is the process in which C# code written or programmed by a developer (_understandable to a human_) is converted into machine or computer understandable code. This code is called [**Intermediate Language**](https://docs.microsoft.com/en-us/dotnet/standard/managed-code#intermediate-language--execution) code (_IL Code_). That is, **the source code is converted into an executable** (_which can be a `.dll` or `.exe` file_).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqi5efvnj0m6qs0hni1t.png)
 

This compilation process is necessary to be able to run the source code on a computer or device by means of an executable file.

Now, understanding the concept of compilation and how it works (_without going into too much depth_), let’s see what decompilation is and how it works.

### Undestanding what is decompilation in .NET

Decompilation is the opposite of compilation. Decompilation is responsible for **converting the machine-understandable code** ([_IL code_](https://docs.microsoft.com/en-us/dotnet/standard/managed-code#intermediate-language--execution)) of an executable (`.exe` _or_ `.dll` _files_) **into the original human-understandable source code** (recovers source code). This makes it possible to analyze, understand and modify the operation of the application or program.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gj7o0325zqif03mwbeg.png)
 
Decompilation is one of the first steps in reverse engineering and cracking of .NET and C# applications.

### Is decompilation in .NET illegal?

The legality of decompiling .NET applications is the same as it would be for any other type of application.

The decompilation of applications is generally legal. According to Section 103 of the [Digital Millennium Copyright Act (17 U.S.C. § 1201)](https://www.law.cornell.edu/uscode/text/17/1201):

> _“A person in legal possession of a program may reverse-engineer and circumvent its protection if that is necessary to achieve “interoperability,” a term that broadly covers other devices and programs that can interact with it, make use of it, and to use and transfer data to and from it in useful ways.”_

For example, in the **USA** it is **legal** as long as the software or application has been obtained legally and, as long as the licensing and use agreement of the application itself prohibits it.

In the **European Union**, decompilation is also **legal** as long as it is for interoperability purposes. However, reverse engineering and decompilation **does not give you permission to publish the findings.**

---

## What is a .NET decompiler and how it works?

A .NET decompiler is a third party **tool used to decompile all types of .NET binaries and libraries.** Since .NET applications and executable files are compiled in IL code, in order to read the code and understand its operation, you have to convert (_decompile_) the IL code to C# code.

### How to decompile .NET applications?

You may wonder why you would want to decompile .NET applications. Maybe you want to delve into the world of decompiling and reverse engineering.

If you are interested in learning **how to decompile any .NET application** (_C#, VB, Xamarin, etc…_) in a few steps and in a very easy way, I leave you below this article **explaining step by step the different phases of decompiling** explaining it with pictures that will teach you how to decompile any .NET application in a very easy way.

{% link https://dev.to/dotnetsafer/i-show-you-how-to-crack-a-net-application-3-clicks-47ke %}

So, let’s see which are the best available decompilers and Assembly Browsers for .NET applications.

---

## What are the Best C# and .NET decompilers?

In the jungle of .NET decompilers and disassemblers there are many options, we can find a great variety of tools and options: Free and paid, open-source and private, online and offline, for different operating systems, etc…

In this top you will see the list of the **most popular and most used decompilers** (both free and paid).

---

### Ildasm.exe IL Disassembler

[Ildasm.exe](https://docs.microsoft.com/en-us/dotnet/framework/tools/ildasm-exe-il-disassembler) is the first decompiler in this top. **This IL disassembler is free** and when you install the Visual Studio IDE, Ildasm.exe is automatically installed along with it.

This free .NET decompiler is written in the .NET language itself _(C#_) by the open source software platform sponsored by Microsoft: [Mono-Project](https://www.mono-project.com/).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eepcvb4a2qtk6kf902vt.png)
 

With Ildasm you can disassemble **any type of binaries and .NET files.** The options included in this disassembler are many, it supports several types of extensions:

-   `.dll`
-   `.exe`
-   `.obj`
-   `.lib`
-   `.winmd`

Its great advantage over other .NET decompilers is, as I explained before, that **it installs automatically together with** [**Visual Studio**](https://visualstudio.microsoft.com/) (_and we all know that Visual Studio is the preferred IDE for .NET development_).

By being automatically installed alongside Visual Studio, **Ildasm has the same cross-platform compatibility as the IDE itself**: You will have no problem using it on the operating system of your choice (Windows, macOs or Linux).

---

### IlSpy .NET Decompiler with support for PDB generation

[ILSpy](https://github.com/icsharpcode/ILSpy) is the second decompiler in this list. Like the previous one mentioned (_Ildasm.exe_), it is a free and open source decompiler and assembly browser, a part is based on **Avalonia** ([_AvaloniaSpy_](https://github.com/icsharpcode/AvaloniaILSpy)).

This disassembler also brings many curious features and that is why it is on this list:

-   Decompilation of applications developed in C#.
-   It allows the decompilation of `BAML` files to `XAML` files.
-   Easy to search for methods, properties or types
-   [**ReadyToRun**](https://docs.microsoft.com/en-us/dotnet/core/deploying/ready-to-run) (_RTR_) support for .NET Core applications.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c5jmlquxbhyhd9xpuu6m.jpg)
 
It is also strongly supported thanks to its **compatibilities with different IDE and operating system versions**:

-   Visual Studio 2017/2019/2022 compatibility.
-   Visual Studio Code support
-   Windows/Mac/Linux compatibility

ILSpy can be installed with the extension for Visual Studio extension or via a [NuGet package](https://www.nuget.org/packages/ICSharpCode.Decompiler/) for your own projects. It also has a special module to run the C# disassembler from a [PowerShell](https://github.com/icsharpcode/ILSpy/tree/master/ICSharpCode.Decompiler.PowerShell).

If you wish, you can consult the [ILSpy repository on GitHub](https://github.com/icsharpcode/ILSpy).

## DnSpy .NET debugger and assembly editor

[DnSpy](https://github.com/dnSpy/dnSpy), the most popular free and open source .NET decompiler? This decompiler is characterized by its **large number of options and tools and above all by its UI design**. Using DnSpy (_for most .NET developers_) is easier and more intuitive than the decompilers mentioned above.

DnSpy is a very **versatile disassembler**, supporting C#, VB, F# code and more. It also has a debug mode for Unity game assemblies and clearly, .NET Core and .NET Framework. It has a **dark theme** (_apart from the light one, obviously_) which is really appreciated, especially for us developers, who could be considered nocturnal creatures ;).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rl2wnmjdsnxxhs4rwfk4.jpg)
 

Another feature of this free and open source decompiler is that it is extensible, that is, **you can create your own extensions on top of dnSpy.**

As a last curious feature, it **supports High DPI monitors** (_maybe someone wants to decompile in 4K 60Hz, who knows_).

Thanks to its breakpoints, you can debug by just pressing `F9` and `F5`. Its **PBD generation is fast and implicit.**

As a curious fact, this decompiler is known to be used by hackers and security and reverse engineering experts.

You can download it form [GitHub](https://github.com/dnSpy/dnSpy)

---

### 9Rays Spices.Net Decompiler

[Spices.NET](https://www.9rays.net/Category/54-spicesnet-decompiler.aspx) is another well-known decompiler for C# applications developed by [9Rays Software Company](https://www.9rays.net/). It features are **source code recovery to avoid crashes** and convert IL assemblies and executables into readable code.

9Rays categorizes Spices.NET as a [**flexible and efficient decompiler**](https://www.9rays.net/Category/54-spicesnet-decompiler.aspx). Another thing that stands out is that it **supports several programming languages**: C#, VB.NET (_Visual Basic_), MSIL (_Microsoft Intermediate Language_), Delphi.NET and J# among others.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13te34y4c7ruq1r6f71h.png)
 
This decompiler **is paid but includes a trial**.

Its main features are:

-   Visual decompiler
-   Active hints
-   IDE’s integration (Visual Studio)
-   Complex Nested statement

It also has the ability to recognize and detect insecure or vulnerable code with pointers in a simple way. You can also extract information from different types of attributes (_also supports custom attributes_).

---

### Redgate .NET Reflector Decompiler

This next .NET application decompiler is on this list because it has been well known and historically used by many developers and companies working with .NET. Is [**commercial decompiler**](https://www.red-gate.com/products/dotnet-development/reflector/) and like the previous one (_Spices.Net_), is paid and has a trial.

This disassembler belongs to the company [RedGate](https://www.red-gate.com/), a software company that offers different tools and solutions to improve productivity when developing.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/umpu0hzpjsbjt6k5cylb.png)
 
With [.NET Reflector](https://www.red-gate.com/products/dotnet-development/reflector/) you can **easily find and fix bugs** in the code even without having access to the original source code. You can also **analyze APIs and different third-party platforms.**

In addition, .NET Reflector features Visual Studio shorcuts, dynamic decompilation, browse assemblies and easy-to-use search filtering. Another of its advantages is that it has **several add-ins**, which allow you to **add more functionality to the decompiler** and get the most out of it.

Too good, isn’t it? Well, the big disadvantage is that it is not supported anymore. Its only support is limited to its forums and documentation.

---

### Telerik JustDecompile .NET Assembly Decompiler & Browser

The .NET decompiler [JustDecompile](https://www.telerik.com/products/decompiler.aspx) was published by [Telerik](https://www.telerik.com/). Telerik is a company that offers different UI products and solutions for developers for testing, reporting and debugging among others. JustDecompile is another free .NET disassembler and as stated on [Telerik’s own website](https://www.telerik.com/products/decompiler.aspx), it is “_10 times faster than competitors_”.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kgmhjgif0ow7wi4ix9l0.png)
 
In terms of features it does not fall short at all:

-   It is extensible just like Ildasm.exe (_it allows you to create your own extensions on the decompiler thanks to its public API and open to everyone_).
-   Fast and easy navigation thanks to its different views in tabs in just one instance.
-   Supports actions via Command prompt.
-   Extract and save resources with Windows Explorer.

This open source decompilation engine is also characterized by the support because **Telerik has a very** [**active community of developers**](https://www.telerik.com/forums) and also has a **good documentation** and **support resources.**

---

### JetBrains dotPeek Free .NET Decompiler & Assembly Browser

[dotPeek](https://www.jetbrains.com/es-es/decompiler/) is another **standalone decompiler** that also integrates with Visual Studio. This Assembly browser belongs to the [JetBrains](https://www.jetbrains.com/) company that offers tools for developers and development teams.

It is a free and quite complete .NET decompiler and supports different formats:

-   executables (`.exe` files)
-   libraries (`.dll` files)
-   [Windows metadata files](https://docs.microsoft.com/en-us/uwp/winrt-cref/winmd-files) (`.winmd` files)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/47ug9khtx30os2l1zr60.png)
 
One of the [main features](https://www.jetbrains.com/decompiler/features/) is that it allows to **export and save the decompiled C# code** to a new Visual Studio project (`.csproj`). It also allows you to **index all assemblies** in a list of your own in order to keep them organized and make navigation easier.

You can search and **highlight any symbol, method, local variable or property.** You can also see the IL code separated from the C# code in a different view. It also has a dark blue theme (_although it can also be synchronized with the Visual Studio color scheme in the settings_).

Finally, [this free .NET decompiler has bookmarks](https://www.jetbrains.com/decompiler/features/): **you can bookmark important parts of the code and come back to them later** (_like web browser bookmarks_), herarchical class navigation and inheritance chains exploration.