Skip to content
← All Tools
🔒All processing in your browser 🚫No uploads stored 🛡️Privacy-first conversion tools No login required
Guide

C# vs VB.NET: Key Syntax Differences Every Developer Should Know

Bill Crawford — Developer Guide — 2026  ·  Last updated September 24, 2025

C# and VB.NET are both first-class .NET languages that compile to identical IL (Intermediate Language) and can use all the same libraries, frameworks, and runtime features. Their syntax, however, is significantly different — C# uses C-style braces and semicolons while VB.NET uses keywords and block terminators. If you're working in a codebase that uses both, or migrating from one to the other, this side-by-side reference will speed up the translation.

Connect on LinkedIn →

Convert C# to VB.NET automatically: Paste any C# class or method and get equivalent VB.NET syntax instantly.

Open C# to VB.NET Converter →

Table of Contents

  1. File and Namespace Structure
  2. Classes and Members
  3. Control Flow
  4. Operators and Keywords
  5. Generics
  6. Exception Handling
  7. LINQ
  8. Language Status in 2026: C# vs VB.NET Today

File and Namespace Structure

C#VB.NET
using System;Imports System
namespace MyApp { }Namespace MyApp ... End Namespace
// comment' comment
/* block comment */' no block comment

Classes and Members

// C#
public class Person
{
    public string Name { get; set; }
    public int Age { get; private set; }

    public Person(string name, int age)
    {
        Name = name;
        Age = age;
    }

    public string Greet() => $"Hello, {Name}!";
}

' VB.NET
Public Class Person
    Public Property Name As String
    Public ReadOnly Property Age As Integer

    Public Sub New(name As String, age As Integer)
        Me.Name = name
        Me.Age = age
    End Sub

    Public Function Greet() As String
        Return $"Hello, {Name}!"
    End Function
End Class

Control Flow

C#VB.NET
if (x > 0) { } else { }If x > 0 Then ... Else ... End If
else if (x == 0)ElseIf x = 0 Then
for (int i = 0; i < n; i++)For i As Integer = 0 To n - 1 ... Next
foreach (var item in list)For Each item In list ... Next
while (condition) { }While condition ... End While
switch (x) { case 1: break; }Select Case x ... Case 1 ... End Select

Operators and Keywords

C#VB.NET
&&AndAlso
||OrElse
!Not
===
!=<>
nullNothing
thisMe
baseMyBase
true / falseTrue / False

Generics

// C#
List<string> names = new List<string>();
Dictionary<int, string> map = new Dictionary<int, string>();

' VB.NET
Dim names As New List(Of String)()
Dim map As New Dictionary(Of Integer, String)()

Exception Handling

// C#
try { }
catch (IOException ex) { Console.WriteLine(ex.Message); }
catch (Exception ex) when (ex.Message.Contains("timeout")) { }
finally { }

' VB.NET
Try
Catch ex As IOException
    Console.WriteLine(ex.Message)
Catch ex As Exception When ex.Message.Contains("timeout")
Finally
End Try

LINQ

LINQ method syntax is nearly identical between C# and VB.NET — the lambda syntax differs slightly:

// C# — method syntax
var adults = people.Where(p => p.Age >= 18).OrderBy(p => p.Name);

' VB.NET — method syntax
Dim adults = people.Where(Function(p) p.Age >= 18).OrderBy(Function(p) p.Name)

LINQ query syntax is also supported in both languages with similar but distinct keyword spellings (from/where/select in C# vs From/Where/Select in VB.NET).

Language Status in 2026: C# vs VB.NET Today

C# 13 (shipped with .NET 9 in November 2024) continues active development with new features including params collections, new lock object semantics, and iterator/async improvements. C# remains Microsoft's primary language for .NET development with a strong yearly release cadence.

VB.NET is in maintenance mode. Microsoft has stated there are no plans to add new language features to VB.NET — it receives only bug fixes and compatibility updates to keep existing codebases running on new .NET versions. New .NET projects should use C#. VB.NET is appropriate only for maintaining existing VB codebases where a full migration is not feasible.

If you are working with a VB.NET codebase and considering migration, see our guide on migrating from VB.NET to C# — including automated conversion tools and common patterns that require manual attention.

Further reading: Microsoft — C# Documentation

BC
Bill Crawford
Founder, Data Conversion Center

Bill Crawford is a data systems developer and technical founder with over 30 years of professional experience in accounting, finance, and business operations.

He holds a Bachelor's degree in Accounting and has spent more than three decades working within financial and operational environments. Over the past 10 years, he has been heavily involved in the development, implementation, and refinement of financial and enterprise data systems for both Fortune 500 companies and smaller organizations.

His work bridges finance and technology — combining deep domain knowledge in structured reporting and accounting workflows with hands-on SQL development and database architecture experience.

Bill founded DataConversionCenter.com to build practical, browser-based tools that simplify complex data challenges, including:

Rather than focusing on theoretical examples, his tools and articles are informed by real-world challenges encountered in enterprise reporting systems, financial databases, and operational data environments.

Professional Background

Bill's mission is to reduce friction in data workflows — particularly for professionals working with structured financial, operational, and reporting data.