Editor only — C# is not executed here
Online C# Editor
A browser-based C# editing surface with proper highlighting for LINQ, attributes, records, async methods and string interpolation. It is deliberately an editor rather than an online C# compiler: the .NET SDK does the building, and this page does the writing.
Can you run C# here? No — and that is deliberate.
AltF Code edits and highlights C#; it does not build or run it. There is no .NET runtime in this page. Write the file here and run it with dotnet run in your own SDK, or open it in Visual Studio or Rider.
A browser can execute only HTML, CSS and JavaScript. Everything else on AltF Code is a full editing surface — real highlighting, real editing, real files — and this page says so instead of advertising a compiler that does not exist.
C# in the editor
A file named main.cs is highlighted with the csharp grammar — the same grammar Visual Studio Code uses.
using System;
using System.Linq;
class Program
{
static void Main()
{
var nums = new[] { 3, 1, 4, 1, 5, 9 };
var evens = nums.Where(n => n % 2 == 0).ToArray();
Console.WriteLine($"sum = {nums.Sum()}, evens = {string.Join(", ", evens)}");
}
}
What you can do with C# here
- Write a class, a LINQ query or a small console program with real C# highlighting anywhere you have a browser.
- Read and tidy C# that arrived as an unformatted paste, then download it as a proper .cs file.
- Keep a scratch file around — local storage keeps it after a refresh, without any account.
C# in this editor — the specifics
| File extension | .cs |
|---|---|
| Syntax grammar | Monaco "csharp" — bundled, no download |
| Code intelligence | Syntax highlighting, bracket matching, comment toggling and word-based suggestions — no type checking |
| Runs in this page | No — editing and highlighting only |
| Run it locally with | dotnet run |
| Cost / account | Free, no sign-up; files stay in your browser |
C# editor — common questions
- Can this compile or run C#?
- No. There is no .NET runtime in the browser, so nothing here is built or executed. It is a C# editor with full highlighting, and it does not advertise itself as an online C# compiler.
- How do I run the code?
- Save the file into a project and run dotnet run, or open it in Visual Studio, Rider or VS Code with the C# extension. For a quick single-file run, dotnet run against a minimal console project works well.
- Is it free?
- Yes — free, no sign-up, and nothing uploaded. Your files live only in your browser's local storage.
- Does it understand modern C# syntax?
- The grammar covers modern C# including records, pattern matching, interpolated strings and async/await. Editor help is syntactic; it does not resolve your NuGet references or report compiler diagnostics.
Start writing C#
The editor opens with a blank file and a cursor. Nothing to install, nothing to sign up for, and your work is saved in your own browser.
Open AltF Code