C# · online compiler

Run C# online

Run C# online — .NET, C# 12/13/14, in a Firecracker microVM. No install.

Available versions
Firecracker microVM live per-test verdicts multi-file compile

C# is Microsoft's cross-platform, statically-typed language and the workhorse of the .NET ecosystem — Unity games, Blazor web apps, enterprise services, cloud functions. Modern C# is fast, expressive, and — since .NET Core — genuinely first-class on Linux.

ls-judge runs C# via the real `dotnet` CLI inside a Firecracker microVM. Choose the language version (12, 13, 14) and get the matching .NET runtime.

Bring a single file (Program.cs) or a multi-file project. Top-level statements work; so does an explicit `Main`. Stdin from the Test panel maps to Console.In.

Starter code

What you get in C#

Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.

c#
C# 14
using System;
class Solution { static void Main() { int n = int.Parse(Console.ReadLine()!.Trim()); Console.WriteLine(n * 2); } }
stdin →21
expected →42
FAQ

Common questions about C# on ls-judge

Which .NET SDK is under C# 14?
.NET 9 — the SDK that ships C# 13; C# 14 uses the current preview SDK where required.
Can I add NuGet packages?
Not on the free tier — the sandbox has no network egress to nuget.org. Bring source only.
Does the runner support top-level statements?
Yes — Program.cs with just `Console.WriteLine("hi");` compiles and runs.
Is Rider / VS integration possible?
Use their SSH remote-run features against your own machine; this playground is browser-first.
Further reading
Also try