C# obfuscator

Protect your compiled C# from casual reverse engineering — free, in the browser, in about a minute.

Inspect a real before-and-after DLL with ILSpy and compare 2,003 runtime results. The downloadable synthetic sample shows what changes and what remains readable.

You obfuscate the build output, not the source

A decompiler like ILSpy or dnSpy does not read your .cs files — it reads the .NET assembly your C# compiles into (a .dll or .exe), where every class, method and field still carries its original, readable name. That is what an obfuscator rewrites.

So the flow is simple: build your project, then upload the compiled assembly. You get back a rewritten copy. Verify both the changed names and your application behavior before releasing it.

How to obfuscate C# code

  1. Build in Release so you upload the assembly you ship, not a debug build.
  2. Find the output — bin/Release/net8.0/YourApp.dll (or .exe).
  3. Upload it on the home page and download the obfuscated copy (named YourApp.obfuscated.dll so it can't overwrite the original).
  4. Run your test suite against the obfuscated build before shipping.

C# case: protect an invoice calculation library

We built a small C# library that calculates line totals, discounts and tax, and a separate console application that calls it through IInvoiceCalculator. This is a self-authored business example, not a customer application. On October 23, 2026, we uploaded the .NET 8 Release library to the public Free endpoint.

The original C# contains a private money-rounding helper. ILSpyCmd 11.0.0.9375 shows the helper and state field renamed in the returned DLL:

Original C#

private int _calculationCount;
private static decimal RoundMoney(decimal value) =>
    decimal.Round(value, 2, MidpointRounding.AwayFromZero);

Protected DLL, decompiled with ILSpy

private int @b;
private static decimal @d(decimal @b) =>
    decimal.Round(@b, 2, MidpointRounding.AwayFromZero);

The arithmetic remains understandable. Free renaming removes selected descriptive names; it does not conceal this algorithm or encrypt its strings. Public Calculate, CalculationCount and Invoice properties remain callable as a library contract.

Did the C# behavior survive?

We compiled the consumer once against the original DLL, then ran that same consumer binary with each library. All ten explicit checks passed with identical output. One invoice uses a unit price of 19.95, quantity 3, discount 10% and tax 13%:

{"subtotal":59.85,"discount":5.99,"tax":7.00,"total":60.86}

Here the discount is rounded first, then tax is calculated on the discounted subtotal. This is the sample's rule, not tax or accounting advice. Checks also cover a zero-price item, a full discount, midpoint rounding, JSON round trips, five event notifications, a state counter and an invalid-quantity exception.

Download C# source and tested DLLs Read the ten-check report

The bundle includes original and protected libraries, the unchanged consumer, source and ILSpy listings. Follow its README to run the checks locally. It establishes this sample's behavior, not compatibility with every C# application. For a deployment-focused walkthrough, see the .NET library replacement test.

What it protects — and what it does not

Renaming turns ValidateLicenseKey into @a: someone reading the decompiled output no longer gets your structure handed to them for free. Being straight about the limits matters more than overselling:

  • Eligible names are rewritten. Private and internal symbols are targets; compatibility exclusions can leave some unchanged. Public renaming is optional for applications and disabled for libraries so existing callers can bind.
  • String literals are readable by default. A connection string or key compiled into your C# stays visible unless you enable string encryption (Pro). Secrets do not belong in a client binary regardless — see what obfuscation actually protects against.
  • It is not a licensing system. A check that runs on the user's machine can be defeated; obfuscation raises the cost, server-side validation changes the outcome.

Reflection and serialization — the one thing to check

If your C# looks up members by their original name — Type.GetMethod("Foo"), [JsonProperty]-free serialization that relies on property names, DI that binds by convention — those names change when obfuscated. Keep [DataContract]/[JsonPropertyName] attributes explicit, and run representative application tests against the protected build. A single successful launch is insufficient; see the reflection and serialization checklist.

Free vs Pro for C#

The free tier renames symbols online with no account. Pro adds string encryption, control-flow obfuscation, call-reference proxying and optional method virtualization, plus larger files, batch mode and a CI/CD API. If you are weighing tools, the comparison pages put us honestly next to ConfuserEx, Dotfuscator, .NET Reactor and SmartAssembly — including where they do more.

Frequently asked about C# obfuscation

How do I obfuscate C# code?

Build the project first, then upload its compiled managed DLL or EXE. This service rewrites the assembly, not pasted C# source. Test the returned build before shipping.

Is this C# obfuscator free?

Free renaming supports one file up to 1 MB with no account. Pro adds larger files, batch processing and additional protection layers; see current limits.

Does obfuscating C# break my program?

Compatibility depends on your application. Public library APIs are preserved, but reflection, serialization, UI bindings and dependencies need testing. The invoice sample demonstrates ten passing checks with an unchanged consumer, not a universal guarantee.

C# is one of several .NET languages this works for — anything that compiles to a managed assembly (VB.NET, F#) obfuscates the same way. More in the guides.

See also the .NET obfuscator overview, or by output type: EXE obfuscator · DLL obfuscator.