Live Batches
Masterclasses
Menu
Free Courses
Account
Login / Sign Up
Difference between int, Int16, Int32 and Int64

Difference between int, Int16, Int32 and Int64

Intermediate 8 min read 19 Sep 2025 166K views
Difference between int, Int16, Int32 and Int64

The Int DataType: An Overview

In the learning phase, developers are not very aware of the difference between primitive, FCL (framework class library), reference, and value types. This causes bugs and performance issues in the code. there are different behaviors of integer types.

In this C# Tutorial, we will explore more about C Sharp int data type which will include C# int Int16 Int32 Int64, int vs Int16 vs Int32 vs Int64. Certified C# professionals earn 20% more than non-certified peers. Get your Free C Sharp Course with Certification today!

int

  1. It is a primitive data type defined in C#.

  2. It is mapped to Int32 of FCL type.

  3. It is a value type and represents a System.Int32 struct.

  4. It is signed and takes 32 bits.

  5. It has a minimum of -2147483648 and a maximum of +2147483647 capacity.

Example

Let's elaborate more about int datatype in C# Compiler

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace HelloWorld
{
	public class Program
	{
		public static void Main(string[] args)
		{
			{
	// Integer value
	int a = 9;
	Console.WriteLine("Integer value="+ a);
}
		}
	}
}

Output

   Integer value=9

Read More - C# Programming Interview Questions

Int16

  1. It is a FCL type.

  2. In C#, the short is mapped to Int16.

  3. It is a value type and represents the System.Int16 struct.

  4. It is signed and takes 16 bits.

  5. It has a minimum -32768 and maximum +32767 capacity.

Example:

 using System; 
using System.Text; 

public class Scholarhat
 { 
static void Main(string[] args) 
{ 

	Console.WriteLine("Int16 MinValue: "+ Int16.MinValue); 
	Console.WriteLine("Int16 MaxValue: "+ Int16.MaxValue); 
	Console.WriteLine(); 

	Int16[] arr1 = {-5, 1, 4, 4, 8}; 

	foreach (Int16 i in arr1) 
	{ 
	Console.WriteLine(i); 
	} 
} 
} 

Output

 Int16 MinValue: -32768
Int16 MaxValue: 32767
-5
1
4
4
8

Int32

  1. It is an FCL type.

  2. In C#, int is mapped to Int32.

  3. It is a value type and represents the System.Int32 struct.

  4. It is signed and takes 32 bits.

  5. It has a minimum -2147483648 and a maximum +2147483647 capacity.

Example:

 using System; 
using System.Text; 

public
class Scholarhat { 

static void Main(string[] args) { 

	Console.WriteLine("Int32 MinValue: "+ Int32.MinValue); 
	Console.WriteLine("Int32 MaxValue: "	+ Int32.MaxValue); 
	Console.WriteLine(); 

	Int32[] arr1 = {-4, 0, 3, 2, 9}; 

	foreach (Int32 i in arr1) 
	{ 
	Console.WriteLine(i); 
	} 
} 
}

 

Output

 
int32 MinValue: -2147483648
Int32 MaxValue: 2147483647

-4
0
3
2
9
 

Int64

  1. It is a FCL type.

  2. In C#, the long is mapped to Int64.

  3. It is a value type and represents the System.Int64 struct.

  4. It is signed and takes 64 bits.

  5. It has a minimum of 9,223,372,036,854,775,808 and a maximum of 9,223,372,036,854,775,807 capacity.

Example:

 
using System; 
using System.Text; 

public class Scholarhat { 

static void Main(string[] args) { 

	Console.WriteLine("Int64 MinValue: "+ Int64.MinValue); 
	Console.WriteLine("Int64 MaxValue: "	+ Int64.MaxValue); 
	Console.WriteLine(); 

	Int64[] arr1 = {-4, 0, 3, 5, 9}; 

	foreach (Int64 i in arr1) 
	{ 
	Console.WriteLine(i); 
	} 
} 
}


 

Output

 Int64 MinValue: -9223372036854775808
Int64 MaxValue: 9223372036854775807

-4
0
3
5
9 

Note

  1. A number of developers think that int represents a 32-bit integer when the application is running on a 32-bit OS and it represents a 64-bit integer when the application is running on a 64-bit OS. This is absolutely wrong.

  2. In C# int is a primitive data type and it is always mapped to System.Int32 whether the OS is 32-bit or 64-bit.

Difference between int, Int16, Int32 and Int64:

Conclusion:

I hope you will enjoy the tips while programming with C#. int, Int16, Int32, and Int64 are all integral data types in C#, but they differ in storage size and range of values. Choosing the right type depends on the range of data you expect to handle and memory considerations. For most applications, int (Int32) is the default choice, but when precision or extremely large numbers are involved, Int64 should be used.

Full-Stack .NET Developers earn up to ₹35 LPA in India’s tech boom. Kickstart your high-paying career with our full stack .NET developer course today!

Frequently asked questions

What is the difference between Int16 and Int32 and Int64?
Int16 can only store values up to 32,767 , Int32 can store values up to 2,147,483,647 and Int64 can store values up to 9,223,372,036,854,775,807
Is int16 faster than Int32?
In theory the int16 is going to be slower than the int32 as it will be cast up to that before the comparison is made
What is the difference between 16-bit integer and 32-bit integer?
 A 16-bit integer means there are 2^16 possible values - generally represented as between 0 and 65,535. 32-bit values range from 0 to 2^32 - 1, or just over 4.29 billion values.
Test yourself in 5 minutes

Take the free Csharp skill challenge to see your strengths and the gaps to fix next.

Start the challenge
Share LinkedIn X Facebook WhatsApp

About the author

Shailendra Chauhan

Shailendra Chauhan

Microsoft MVP, Founder & CEO at ScholarHat

He is a renowned Speaker, Solution Architect, Mentor, and 11-time Microsoft MVP (2016–2026). With expertise in AI/ML, GenAI, System Design, Azure Cloud, .NET, Angular, React, Node.js, Microservices, DevOps, and Cross-Platform Mobile App Development, he bridges traditional frameworks with next-gen innovations.

He has trained 1 Lakh+ professionals across the globe, authored 45+ bestselling eBooks and 1000+ technical articles, and mentored 20+ free courses. As a corporate trainer for leading MNCs like IBM, Cognizant, and Dell, Shailendra continues to deliver world-class learning experiences through technology & AI.

Keep learning

Courses that go with this tutorial