Practice C# online
A free C# editor that compiles with the real C# compiler (Roslyn) and runs on .NET, inside your browser. Write top-level code or a full class, press Run, and type your answers when Console.ReadLine asks.
C# 13 on .NET 9 · free · no sign-up · runs in your browser
C# practice problems for beginners
Each one opens in the editor above as a working program with something left for you to finish.
- problem 1
Greet me
Read a name and an age with Console.ReadLine, then print one sentence that uses both.
- problem 2
Even or odd
Read a whole number and use % to say whether it's even or odd.
- problem 3
FizzBuzz
Count to 30 with a for loop, saying Fizz, Buzz or FizzBuzz for multiples of 3, 5 or both.
- problem 4
Scores with a List
Total a List<int> with foreach, then use LINQ to find the average and the best score.
- problem 5
A Player class (Unity-style)
Practice classes the way Unity scripts use them: a Player with health that takes damage.
- problem 6
Reverse a word
Build a word backwards with a for loop, then check whether it's a palindrome.
A free online C# compiler that runs in your browser
- C# 13 on .NET 9, compiled by Roslyn, the same compiler Visual Studio uses
- Console.ReadLine works: the program pauses and you type in the console
- Top-level statements or a classic Main, with List, Dictionary and LINQ ready to use
- Compiler errors point to the exact line and column
- The C# you practice here is the same language Unity scripts use
- Your code is remembered in your browser, and Share gives you a link
C# editor questions
Is this C# editor free?
Yes. It's free, with no sign-up, no ads and no tracking. Your code runs in your own browser and isn't sent anywhere unless you press Share to make a link.
Which version of C# and .NET is it?
C# 13 on .NET 9, compiled by Roslyn running in your browser. System, System.Collections.Generic, System.Linq and System.Text are already imported, so you can start typing straight away.
Does Console.ReadLine work?
Yes. When your program calls Console.ReadLine, it pauses and you type your answer in the console, then press Enter.
Can I write Unity code here?
Not on this page, which runs plain C#. In the main editor, make a Unity C# file: it plays Unity-style scripts in a small 2D engine in your browser (not the real Unity, so no 3D or imported art). The C# you practice here carries straight over.
Do crashes show the line number?
Compile errors do, with line and column. A crash while the program runs shows the error and the method it happened in, but not the exact line.
Does it work on a Chromebook, iPad or phone?
Yes, in any up-to-date browser: Chrome, Safari, Edge or Firefox, including school Chromebooks. The first run downloads about 6 MB, then your browser keeps it, so later visits start fast.
Are there any limits?
A program can run for 10 seconds (time spent waiting for you to type doesn't count), and programs can be up to 20,000 characters. That's plenty for practice problems, school assignments and small projects.
Want a coach while you practice?
HopeCoders teaches C# 1-on-1 for all ages, from first programs to school projects and Unity games. Every coach is background checked, and sessions happen in person across Greater Los Angeles, from Pasadena, Burbank and Beverly Hills to the South Bay, Long Beach and north Orange County, or online over Zoom.