Online C# Compiler
Compile and run C# online with C# 14 on .NET 10. Write top-level statements or a class with a Main method, press Run, and the Roslyn compiler builds your program and starts it, with errors and output shown beside your code. Programs can read input with Console.ReadLine as they run.
How to run C# code online
- This page opens with C# selected, so you can start typing straight away.
- Write your code in the editor, or open files from your computer: single files, or a whole project as a .zip.
- Press Run, or Ctrl+Enter. The output appears in the panel beside the editor, and when the program asks for input you type it there and press Enter.
- Share a copy with a link, or save your files to your computer.
C# 14 (.NET 10) on Online IDE
- Your code is compiled with the Roslyn C# compiler and runs on .NET 10, either as top-level statements, as in dotnet new console, or in a class with a static Main method.
- The namespaces a new console project imports are already there: System, System.Collections.Generic, System.IO, System.Linq, System.Net.Http, System.Threading and System.Threading.Tasks.
- Every .cs file in your project is compiled together, so classes can live in files of their own.
- Console.ReadLine() reads a line of input: type it in the output panel and press Enter.
Example: a C# program that reads input
Console.Write("Enter some numbers separated by spaces: ");
string line = Console.ReadLine() ?? "";
List<int> numbers = line.Split(' ', StringSplitOptions.RemoveEmptyEntries)
.Where(part => int.TryParse(part, out _))
.Select(int.Parse)
.ToList();
if (numbers.Count == 0)
{
Console.WriteLine("There are no whole numbers in that line.");
}
else
{
Console.WriteLine($"Sum: {numbers.Sum()}, average: {numbers.Average():0.##}, largest: {numbers.Max()}");
}
Features of this tool
- Simple and fastA clean, lightweight editor that opens instantly.
- Powered by AceThe Ace code editor, with syntax highlighting, autocompletion and bracket matching.
- Interactive programsType input into the terminal while your program runs.
- Several filesWork in tabs, open files or a .zip from your computer, and save the project back to disk.
- Made for learningHelpful for beginners to learn and practice programs.
- Light and dark themesPlus 39 editor themes, a choice of coding fonts, and Vim, Emacs or VS Code keys.
- Keep your outputCopy or download the program output in one click.
- Share by linkSave your code in the cloud and open it anywhere.
Frequently asked questions
Which C# version does Online IDE use?
C# 14 on .NET 10, compiled with the Roslyn C# compiler on Linux.
Do I need a class with a Main method?
No. Top-level statements work, as in a new .NET console project, and common namespaces such as System, System.Linq and System.Collections.Generic are already imported. A class with static void Main works too.
How does a C# program read input?
Call Console.ReadLine() where you need a line, then type it in the output panel and press Enter.
Can I use NuGet packages?
No. The .NET class library is available, but NuGet packages are not installed and programs cannot download them.
Contact us
For any feedback, queries or issues, please feel free to contact us or write to . We value your input and are committed to providing the best possible experience for our users.