About C# Lab

A free site for learning C# where every example actually runs — in your browser, not on our server.

What makes it different

Most C# tutorials show code in screenshots. Here every snippet has a Run button, powered by a small C# interpreter (~60 KB of JavaScript) that ships with the page. There is no backend: your code, your inputs and your drafts never leave your device.

The error pages take it one step further — they show real compiler diagnostics (error CS0029…) produced by the same rules the Roslyn compiler uses for the teaching subset, so what you practice here matches what Visual Studio tells you.

What the engine supports

The teaching core, deliberately: variables and the core types (int, double, string, bool, char), var; all loops and switch; methods (overloads, default and out parameters, recursion); classes, structs, inheritance, interfaces, enums, auto-properties, statics; arrays, List<T>, Dictionary<K,V>; try/catch/finally with the real exception hierarchy; Console, Math, Convert, string APIs and $"…" interpolation.

Not yet available (the site tells you honestly when you hit one; all of it runs fine in Visual Studio): LINQ, lambdas, async/await, delegates/events, generics you declare, multi-dimensional arrays, properties with bodies, DateTime, StringBuilder.

Safety rails: infinite loops are stopped by a 5-million-step watchdog instead of freezing your tab; output is capped at 200,000 characters; recursion deeper than ~900 frames reports a stack overflow like the real runtime.

Who made this

An independent developer who learn-in-publics and likes zero-infrastructure websites. No tracking, no accounts, no newsletter popups. If it helped you, the problem set and the error decoder are the deepest parts of the site.

Found a bug or a missing explanation? Send feedback — a real human reads it.