Built-in types (C# reference)

The following table lists the C# built-in value types:

C# type keyword .NET type
bool System.Boolean
byte System.Byte
sbyte System.SByte
char System.Char
decimal System.Decimal
double System.Double
float System.Single
int System.Int32
uint System.UInt32
nint System.IntPtr
nuint System.UIntPtr
long System.Int64
ulong System.UInt64
short System.Int16
ushort System.UInt16

The following table lists the C# built-in reference types:

C# type keyword .NET type
object System.Object
string System.String
dynamic System.Object

In the preceding tables, each C# type keyword from the left column (except nint and nuint and dynamic) is an alias for the corresponding .NET type. They are interchangeable. For example, the following declarations declare variables of the same type:

int a = 123;
System.Int32 b = 123;

The nint and nuint types are native-sized integers. They are represented internally by the indicated .NET types, but in each case the keyword and the .NET type are not interchangeable. The compiler provides operations and conversions for nint and nuint as integer types that it doesn't provide for the pointer types System.IntPtr and System.UIntPtr. For more information, see nint and nuint types.

The void keyword represents the absence of a type. You use it as the return type of a method that doesn't return a value.

See also