Online C# compiler

This compiles your C# with the real Roslyn compiler, in the browser. Your code never leaves this tab.

Program.csRoslyn on .NET 10 WASM

Press Run. The Roslyn on .NET 10 WASM engine (about 6 MB) downloads once on your first run, then stays cached.

C# · runs in your browser · nothing uploadedLn 1, Col 1

// Free tool

This compiles your C# with the real Roslyn compiler, in the browser - on the .NET WebAssembly runtime, with no SDK installed and nothing uploaded. LINQ, records, pattern matching and generics all behave as they do in a console project.

Nothing you type is sent to a server. Your code is saved only in this browser, the engine is downloaded once and cached, and once it has loaded the page keeps running your code with the network off. No account, no sign-in, no limit on how many times you press Run.

// What you get

Roslyn on .NET 10 WASM, in a browser tab

The real Roslyn compiler running on the .NET WebAssembly runtime - your code is compiled to IL and executed, in the tab.

What it supports

  • C# 13 on .NET 10: records, pattern matching, LINQ, generics, async methods, spans and string interpolation.
  • System, System.Collections, System.Linq, System.Text.RegularExpressions and System.Numerics.
  • Roslyn's own compiler errors, with their CS numbers and line numbers.

What it does not

  • Your entry point has to be a class named Program with a static Main. Top-level statements are not supported here.
  • No stdin, no files and no network: Console.ReadLine, System.IO and HttpClient have nothing behind them.
  • Culture-specific formatting is unavailable - the runtime is built without ICU, so formatting is invariant.
  • A program is stopped after 10 seconds.

// Why it runs here

Your code never leaves the tab

Most online compilers send your code to a server, run it in a container, and send the output back. That means a queue when the site is busy, a hard cap on how long your program may run, and a copy of your code on someone else's disk. This one downloads the compiler instead, once, and runs everything locally from then on.

No upload, no account

  • The compiler is fetched once and cached; your source is never sent anywhere.
  • Nothing is stored on our side. Your code is kept in this browser only, so it is still here when you come back.
  • Once the engine has loaded, it keeps running with the network off, which a hosted sandbox cannot do.

Then practice it for real

  • A runner tells you what your code printed. It cannot tell you whether you have learned anything.
  • Prepshotz runs the same engines against real test cases and grades the result.
  • Practice C# with graded problems →

// Questions

C# in the browser - FAQ

01Why do I need a Program class instead of top-level statements?

Because your code is compiled as a library and then invoked, rather than published as an executable, and top-level statements require an executable. A class named Program with a static Main is what the runner looks for.

02Is this the real .NET?

Yes. Roslyn and the .NET runtime are both compiled to WebAssembly, so your code is compiled to real IL and executed by the real runtime. That is also why the first run downloads about 6 MB.

03Does my code get uploaded anywhere?

No. The compiler runs inside your browser tab, so your code never leaves your machine. There is no server to send it to and nothing is logged on our side. Your code is kept only in this browser, and a share link carries it inside the link itself.

04Is it really free, and do I need an account?

Yes, and no. Every tool here runs without an account, a card, or a sign-in. They are free because they cost us nothing per run: the compiler is downloaded to your browser once and your own machine does the work.

Run C# here. Get graded on it there.

Free while we're in beta.