Hello, World!
using System;
class Program {
static void Main() {
Console.WriteLine("Hello, World!");
}
}Tap Run to execute
Program.cs · output appears here
Press Run to execute
Output streams here as your program runs.
C# is a statically typed, multi-paradigm language created by Microsoft under Anders Hejlsberg, first released in 2002 alongside the .NET platform. It combines object-oriented and functional features with strong typing, automatic memory management, and a modern syntax. C# compiles to intermediate language that runs on the .NET runtime, giving it portability and just-in-time performance.
Today C# is used for web backends with ASP.NET Core, desktop apps, cloud services on Azure, and game development with Unity. The language has evolved rapidly, adding async/await, pattern matching, records, and nullable reference types. This compiler runs on the .NET SDK reporting version 5.0.201, so you can write modern C# programs and use the extensive .NET base class library.
Program.cs is the entry point. Add helper files from the explorer and import them into your project.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
Program.cs and Helper.cs compile in the same generated project.
using System;
class Program
{
static void Main()
{
Console.WriteLine(Helper.Answer());
}
}
internal static class Helper
{
public static int Answer() => 42;
}
using System;
class Program {
static void Main() {
Console.WriteLine("Hello, World!");
}
}using System;
class Program {
static void Main() {
string name = Console.ReadLine();
Console.WriteLine($"Hello, {name}!");
}
}using System;
using System.Collections.Generic;
class Program {
static void Main() {
var fruits = new List<string> { "apple", "banana", "cherry" };
foreach (var fruit in fruits) {
Console.WriteLine(fruit);
}
}
}using System;
class Program {
static long Factorial(int n) => n <= 1 ? 1 : n * Factorial(n - 1);
static void Main() {
Console.WriteLine(Factorial(5));
}
}using System;
class Program {
static void Main() {
try {
int x = int.Parse("abc");
Console.WriteLine(x);
} catch (FormatException e) {
Console.WriteLine("Invalid number: " + e.Message);
} finally {
Console.WriteLine("Done");
}
}
}using System;
using System.Collections.Generic;
class Program {
static void Main() {
var counts = new Dictionary<char, int>();
foreach (char c in "banana") {
counts[c] = counts.GetValueOrDefault(c, 0) + 1;
}
foreach (var kv in counts) {
Console.WriteLine($"{kv.Key}: {kv.Value}");
}
}
}using System;
using System.Linq;
class Program {
static void Main() {
int[] nums = { 3, 1, 4, 1, 5 };
var sorted = nums.OrderBy(n => n).ToArray();
Console.WriteLine(string.Join(", ", sorted));
Console.WriteLine("Sum: " + nums.Sum());
}
}using System;
class Person {
public string Name { get; set; }
public int Age { get; set; }
public string Describe() => $"{Name} ({Age})";
}
class Program {
static void Main() {
var p = new Person { Name = "Ada", Age = 36 };
Console.WriteLine(p.Describe());
}
}using System;
record Point(int X, int Y);
class Program {
static string Describe(Point p) => p switch {
(0, 0) => "origin",
var (x, y) => $"({x}, {y})"
};
static void Main() {
Console.WriteLine(Describe(new Point(0, 0)));
Console.WriteLine(Describe(new Point(2, 3)));
}
}using System;
class Program {
static void Main() {
string? maybe = null;
int len = maybe?.Length ?? -1;
Console.WriteLine(len);
}
}The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Type or paste your code into the editor, then click Run (or press Ctrl/Cmd + Enter) to execute it.
Output streams into the console panel, including runtime errors, exit status, and execution time.
Nothing to install and no account to create — code runs in an isolated hosted runtime.
Language-aware autocomplete and IntelliSense suggestions where the editor has a matching language service
Syntax highlighting, with native compiler and runtime errors shown in the console
Bracket matching, auto-indentation, code folding, and a minimap
Multi-cursor editing plus find & replace (Ctrl/Cmd + F)
Full undo/redo history and copy to clipboard
Built on Monaco — the same editor that powers VS Code
Run on demand, or turn on Auto-run to execute on every change
Stop long-running or infinite programs at any time
A real console shows standard output, errors, exit status, and execution time
Pass standard input (stdin) to your program from the Input panel — one value per line
Switch between light and dark themes
Adjust font size and other editor settings
Toggle side-by-side or top/bottom layouts
Enter distraction-free fullscreen mode
Generate a shareable link to your exact code in one click — no login needed
Your work autosaves to your browser, so you can pick up where you left off
Copy the active file to your clipboard
Run code: Ctrl/Cmd + Enter
Find & replace: Ctrl/Cmd + F
Open the full shortcut list from the keyboard icon in the toolbar
C# is one of 23 linked-project compilers. Run always starts Program.cs; selecting a helper tab changes what you edit, not the entry file.
Program.cs and Helper.cs compile in the same generated project.
Linked-project languages (23): Node.js, TypeScript, Deno, Python, C, Go, Dart, Swift, Rust, Ruby, PHP, Java, Kotlin, C++, C#, Nim, Crystal, Haxe, Zig, Scala, D, Bun, Objective-C.
Single-file scratchpads (46): Matplotlib, NumPy, pandas, Haskell, Clojure, Perl, Lua, Tcl, jq, Raku, Elixir, Bash, Zsh, Nushell, R, Assembly (NASM), Julia, Octave, Groovy, PowerShell, Visual Basic .NET, Odin, Pascal, Lisp, Erlang, CoffeeScript, COBOL, BASIC, V, Racket, OCaml, Prolog, AWK, Emacs Lisp, Emojicode, Forth, F#, Fortran, Assembly (NASM64), Solidity, Mojo, Ada, WASM (WAT), Gleam, Shell Script (sh), Scheme. Their extra project files are not submitted to the runtime.
Download project exports every C# tab and a README in one ZIP archive.