This page doesn't work on Internet Explorer. We recommend you try the new Microsoft Edge browser.
Why C#
C# is a modern, innovative, open-source, cross-platform object-oriented programming language and one of the top 5 programming languages on GitHub.
Do you have experience with JavaScript, Java, or C++? You'll find C# instantly familiar, and you'll enjoy its evolving features including type safety, generics, pattern matching, async, records, and more.
We hope you'll fall in love with C# from the very first keystroke.
Try C#
Console.WriteLine("Hello World");
var names = new[] { "Ana", "Felipe", "Emillia" };
foreach(var name in names)
{
Console.WriteLine($"Hello {name}");
}
Console
var (name, price, perPackage) = ("pizza dough", 1.99m, 3);
var date = DateTime.UtcNow;
Console.WriteLine(
$"On {date.ToLongDateString()} at {date.ToShortTimeString()}, \n"+
$"the price of {name.ToUpper()} \n" +
$"was {price} per {perPackage} packages.");
Console
var names = new[] { "Ana", "Felipe", null, "Emillia" };
names.Where(name => name?.Length > 5)
.OrderBy(name => name)
.ToList()
.ForEach(Console.WriteLine);
Console
public static double ComputeArea(object shape)
=> shape switch
{
Square s => s.Side * s.Side,
Circle c => c.Radius * c.Radius * Math.PI,
Rectangle r => r.Height * r.Length,
_ => throw new ArgumentException(
message: "Unrecognizable shape",
paramName: nameof(shape))
};
Person person = new("Nancy", "Davolio");
Console.WriteLine(person);
// Output: Person { FirstName = Nancy, LastName = Davolio }
public record Person(string FirstName, string LastName);
Productive developer environment
Build your apps faster with world-class developer tools that help you write precise, accurate, and maintainable code the first time.
Use a wide variety of tools that fit your development style available on every platform including Visual Studio Code (an advanced code editor), Visual Studio (a powerful IDE), command-line tools, and other popular tools.
Loved by developers, trusted by enterprise
C# is one of the top 5 languages used by projects on GitHub and is consistently one of the most loved languages on Stack Overflow's developer survey.
Hundreds of thousands of companies worldwide use C# to power their business across a vast array of industries including media, finance, healthcare, gaming, and more.
An open, vibrant community
Become part of our community of over 5 million developers for you to get support and learn from on Stack Overflow, Microsoft Q&A, .NET Live TV, YouTube, and more.
C# is open source on GitHub. Get involved and join the developers and companies already contributing to it.
Build anything with C#
C# is the most popular language for .NET development. With .NET you can target any application type running on any platform. Reuse your skills, code, and favorite libraries across all of them in a familiar environment. That means you can build apps faster, with less cost.
From mobile applications running on iOS and Android, to enterprise server applications running on Windows Server and Linux, or high-scale microservices running in the cloud, .NET provides a solution for you.
Learn C# with developers
Explore the concepts and syntax of the C# programming language with live coding demos in our C# for Beginners video series.
Once you learn the basics, explore other lessons at the .NET videos page where you can learn to build any type of app with C#.
Data sourced from official tests available at TechEmpower Round 21.
Performance where it matters
.NET is fast. Really fast! That means applications provide better response times and require less compute power.
The popular TechEmpower benchmark compares web application frameworks with tasks like JSON serialization, database access, and server side template rendering - .NET performs faster than any other popular framework.
Made it this far, but not ready to install?
Our in-browser tutorial will get you started learning C# today. No install needed.