I know it's equal to sizeof(int). The size of an int is really compiler dependent. Back in the day, when processors were 16 bit, an int was 2 bytes. Nowadays, it's most often 4 bytes on a 32-bit as well as 64-bit systems.

Still, using sizeof(int) is the best way to get the size of an integer for the specific system the program is executed on.

EDIT: Fixed wrong statement that int is 8 bytes on most 64-bit systems. For example, it is 4 bytes on 64-bit GCC.

Answer from yhyrcanus on Stack Overflow
🌐
Reddit
reddit.com β€Ί r/c_programming β€Ί what, exactly, is the specification for the size of the int type
r/C_Programming on Reddit: What, exactly, is the specification for the size of the int type
January 27, 2025 -

Hai there, I had an embedded software exam today where one of the questions stated:

The C language is centered around the int data type that represents the canonical machine word.
- As such the size of an int is architecture dependent.

And the answer to this true/ false question was true. Now I understand that's the answer they were fishing for, but I made the frankly stupid decision to be pedantic so now I need to down the rabbit hole to see if I'm right.

In my understanding, while the int type is architecture dependent (although I'm not 100% certain that's specified), it does not represent the canonical machine word. On my x86_64 machine, int is 32 bits, not 64, and I know that int cannot be less than 16 bits, so on 8 bit processors cannot have int be their word size.

Looking around online, I've found a stack overflow answer that the relation to machine words are more a suggestion rather than a rule. However that did not link to a part of the C spec.

I made an attempt looking in the C24 draft spec (that one was free) but wasn't able to find any useful information quickly in ~700 pages, outside the fact that the minimum size is indeed 16 bits.

So my concrete question: where, if anywhere, in the C spec can I find what the C programming language defines as the size of the int type and if it's at all in relation to word size of a particular architecture, so I can disprove either my professor or myself.

Thank you in advance :)

People also ask

What differentiates the range for unsigned and signed types?
Although the size of any unsigned as well as the signed data type is all the same, they both possess different ranges of values to be stored in any variable. Why? It is because the representation of the signed numbers is in 2’s complement form in any processor or machine. For instance, the representation of the number -23 in the form of 2’s complement would be: (Decimal) 23 <-> (Binary) 10111
🌐
byjus.com
byjus.com β€Ί gate β€Ί size-of-data-types-in-c
Size of Data Types in C
Why do we use the floating data types?
The C language specifies two of the primary data types for storing the fractional numbers or the floating-point. These are double or float. One can easily apply the long qualifiers on the double. Thus, we get another type, which is the long double. Β· In a computer system, the IEEE-754 format represents the floating-point numbers. A majority of modern processors and processors adopt this format. It has two major representations: Β· 1. 32-bit single precision Β· 2. 64-bit double precision
🌐
byjus.com
byjus.com β€Ί gate β€Ί size-of-data-types-in-c
Size of Data Types in C

I know it's equal to sizeof(int). The size of an int is really compiler dependent. Back in the day, when processors were 16 bit, an int was 2 bytes. Nowadays, it's most often 4 bytes on a 32-bit as well as 64-bit systems.

Still, using sizeof(int) is the best way to get the size of an integer for the specific system the program is executed on.

EDIT: Fixed wrong statement that int is 8 bytes on most 64-bit systems. For example, it is 4 bytes on 64-bit GCC.

Answer from yhyrcanus on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί c language β€Ί c-program-to-find-the-size-of-int-float-double-and-char
C Program to Find the Size of int, float, double and char - GeeksforGeeks
July 23, 2025 - Size of int is: 4 bytes Size of float is: 4 bytes Size of double is: 8 bytes Size of char is: 1 bytes ... In C, when you increment or decrement a pointer, the address changes based on the size of the data type it points to, not just by 1.
🌐
Wikipedia
en.wikipedia.org β€Ί wiki β€Ί C_data_types
C data types - Wikipedia
April 7, 2026 - Since C23, the only representation allowed is two's complement, therefore the values range from at least [βˆ’2nβˆ’1, 2nβˆ’1βˆ’1]. ... ^ a b Uppercase differs from lowercase in the output. Uppercase specifiers produce values in the uppercase, and lowercase in lower (%A, %E, %F, %G produce such ...
🌐
Quora
quora.com β€Ί What-is-the-actual-size-of-int-in-the-C-language-2-4-or-8-bytes
What is the actual size of 'int' in the C language, 2, 4, or 8 bytes? - Quora
Answer (1 of 17): > What is the actual size of "int" in the C language, 2, 4, or 8 bytes? The size of [code ]int[/code] in C is [code ]sizeof (int)[/code]. [code ]int[/code] is an integer type whose size is chosen by the implementation (and ...
Find elsewhere
🌐
Programiz
programiz.com β€Ί c-programming β€Ί examples β€Ί sizeof-operator-example
C Program to Find the Size of int, float, double and char
The sizeof(variable) operator computes the size of a variable. And, to print the result returned by sizeof, we use either %lu or %zu format specifier. #include<stdio.h> int main() { int intType; float floatType; double doubleType; char charType; // sizeof evaluates the size of a variable printf("Size of int: %zu bytes\n", sizeof(intType)); printf("Size of float: %zu bytes\n", sizeof(floatType)); printf("Size of double: %zu bytes\n", sizeof(doubleType)); printf("Size of char: %zu byte\n", sizeof(charType)); return 0; }
🌐
Programiz
programiz.com β€Ί c-programming β€Ί c-data-types
C Data Types
The size of int is 4 bytes. Here's a table containing commonly used types in C programming for quick access.
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί c++ β€Ί difference-between-sizeofint-and-sizeofint-in-c-c
Difference between sizeof(int *) and sizeof(int) in C/C++ - GeeksforGeeks
July 23, 2025 - int means a variable whose datatype is integer. sizeof(int) returns the number of bytes used to store an integer. int* means a pointer to a variable whose datatype is integer.
🌐
BYJUS
byjus.com β€Ί gate β€Ί size-of-data-types-in-c
Size of Data Types in C
February 16, 2024 - These character data types are capable of storing the ASCII characters or the numbers that are equivalent to the ASCII characters. The size of both unsigned and signed integers is about 2 bytes in a majority of the compilers.
🌐
Microsoft Learn
learn.microsoft.com β€Ί en-us β€Ί cpp β€Ί c-language β€Ί type-int
Type int | Microsoft Learn
August 3, 2021 - In 32-bit operating systems, the int type is usually 32 bits, or 4 bytes. Thus, the int type is equivalent to either the short int or the long int type, and the unsigned int type is equivalent to either the unsigned short or the unsigned long ...
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί c language β€Ί data-types-in-c
Data Types in C - GeeksforGeeks
We use int keyword to declare the integer variable: Size: typically 4 bytes, Range: -2,147,483,648 to 2,147,483,647. Format specifier: %d. Format specifiers are the symbols that are used for printing and scanning values of given data types.
Published Β  April 22, 2026
🌐
TutorialsPoint
tutorialspoint.com β€Ί cprogramming β€Ί c_data_types.htm
C - Data Types
Note: "sizeof" returns "size_t". The type of unsigned integer of "size_t" can vary depending on platform. And, it may not be long unsigned int everywhere. In such cases, we use "%zu" for the format string instead of "%d".
🌐
Quora
quora.com β€Ί Why-is-the-size-of-an-int-in-C-4-bytes-on-most-systems
Why is the size of an int in C 4 bytes on most systems? - Quora
2 bytes is too small, only representing 65536 possible numbers. 4 bytes is (65536)x(65536) = 4,294,967,296 that is big enough for most applications, and small enough to dont waste memory. As alternative you can use a 8 bytes long i...
🌐
Usrmisc's Blog
usrmisc.wordpress.com β€Ί 2012 β€Ί 12 β€Ί 27 β€Ί integer-sizes-in-c-on-32-bit-and-64-bit-linux
Integer sizes in C on 32 bit and 64 bit Linux | Usrmisc's Blog
March 31, 2019 - The β€œz” length modifier refers to size_t, see printf(3) for a couple of similar ones. The PRIu32 macro makes sure that a constant word length is used regardless of the compiler specific length of the integer types. This and several similar macros are in fact standardized in C99, they are ...
🌐
Quora
quora.com β€Ί What-is-the-actual-size-of-INT-in-the-C-language-2-or-4-bytes
What is the actual size of INT in the C language, 2 or 4 bytes? - Quora
Answer (1 of 3): The C language does not give [code ]int[/code] a specific size. Rather, it places some constraints on its size: * It must be a minimum of 16 bits. * [code ]sizeof(char)
🌐
Quora
quora.com β€Ί How-many-bytes-in-INT-are-in-C-4-or-8-bytes
How many bytes in INT are in C, 4 or 8 bytes? - Quora
The C standard only requires the following to determine the size of an int: CHAR_BIT >= 8. [1] This is the number of bits in a char.