Swelıty
Tools for everyone

Free Online C# Playground

Write C# code and run it, with the output shown in a console. Your code is sent to a free online service to be compiled and run.

Press Run, or Ctrl or Cmd + Enter, to run your code. The output is shown in Console. C# runs on a remote server, so it needs a connection, can be busy, and can take half a minute to answer. Top-level statements work, so no Main method is needed. It stops after 90 seconds. Input is not available.

Program.cs

Preview

Console

Output appears here. Press Run, then try console.log("Hello")

As with any online tool, we highly recommend not including sensitive data in your code, such as passwords, API keys or other secrets.

How to use

  1. Write your C# code in the Program.cs tab. Top-level statements work, so you do not need a Main method.

  2. Press Run, or Ctrl or Cmd + Enter. The output appears in the Console panel.

  3. A run can take up to half a minute, because a project is built each time, and it is stopped after 90 seconds.

  4. There is no keyboard input, so put your test data in the code.

  5. Copy the code, download your files or clear the editor with the icons above it.

  6. Open the full screen editor for more room, and use the A buttons to resize the text.

Why use this tool

  • C# 10 on .NET 6

    The newest .NET version that runs reliably on the service, with top-level statements, records and LINQ.

  • Built-in console

    Program output and compiler errors with line numbers appear beside the preview.

  • Nothing to install

    Your code is run for you on a remote server.

  • Comfortable editor

    Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.

About this tool

Write C# code and run it online, with the output shown in a console. Learn records, LINQ, pattern matching and top-level statements, or check how a method behaves without installing the .NET SDK. C# cannot run inside a web page, so your code is sent to a free online code-running service that builds and runs it and returns the output. Never paste passwords, API keys or other secrets.

Frequently asked questions

Yes. C# cannot run in a web page, so this playground sends your code to a free online code-running service that builds and runs it and returns the output. That service receives your code and your IP address, as any website does. Never include passwords, API keys or other secrets. The Go, PHP, Rust, Java, C# and Bash playgrounds all work this way, and each says so on its page.

.NET needs an SDK to build and run, which cannot be done inside a web page in a practical way. Running it on a remote server is the way that works well.

C# 10 on .NET 6, the newest version that runs reliably on the service. The preview shows the exact build after each run.

The service is free, so it can be busy or unreachable. Check your connection and try again in a moment.

The service creates and builds a small project each time, which takes a few seconds before your program starts.

Only what the language includes. Packages and libraries cannot be installed here.

Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.