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

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
๐ŸŒ
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 ...
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
๐ŸŒ
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 :)

๐ŸŒ
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.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ c language โ€บ data-types-in-c
Data Types in C - GeeksforGeeks
Primitive data types are the basic ... negative, or zero). We use int keyword to declare the integer variable: Size: typically 4 bytes, Range: -2,147,483,648 to 2,147,483,647....
Published ย  April 22, 2026
๐ŸŒ
Yale University
cs.yale.edu โ€บ homes โ€บ aspnes โ€บ pinewiki โ€บ C(2f)IntegerTypes.html
C/IntegerTypes
The general convention is that int is the most convenient size for whatever computer you are using and should be used by default. Whether a variable is signed or not controls how its values are interpreted. In signed integers, the first bit is the sign bit and the rest are the value in 2's complement notation; so for example a signed char with bit pattern 11111111 would be interpreted as the numerical value -1 while an unsigned char with the same bit pattern would be 255.
Find elsewhere
๐ŸŒ
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.
๐ŸŒ
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".
๐ŸŒ
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.
๐ŸŒ
W3Schools
w3schools.com โ€บ c โ€บ c_data_types.php
C Data Types
1 month ago - HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT SWIFT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING HTML & CSS BASH RUST TOOLS ... Create Variables Format Specifiers Change Values Multiple Variables Variable Names Real-Life Examples Code Challenge C Data Types ยท Data Types Characters Numbers Decimal Precision Memory Size Real-Life Example Extended Types Code Challenge C Type Conversion C Constants C Operators
๐ŸŒ
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; }
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ cpp โ€บ c-language โ€บ cpp-integer-limits
C and C++ Integer Limits | Microsoft Learn
These limits are defined in the ... the declaration of sized integer variables, which are integral types of size 8-, 16-, 32- or 64-bits....
๐ŸŒ
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 ...
๐ŸŒ
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++ โ€บ 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.
๐ŸŒ
Reddit
reddit.com โ€บ r/c_programming โ€บ do the sizes of data types in c such as char, short, and int have specified minimum size or relative in the c standard?
r/C_Programming on Reddit: Do the sizes of data types in C such as char, short, and int have specified minimum size or relative in the C standard?
October 9, 2024 -

So, I ask this question because in my C class at college, my professor said that in the C standard, only relative size of char short and int are specified to keep the language flexible to any hardware architecture setup. sizeof char <= short <= int. ChatGPT seems to have confirmed this saying:

Relative Size: In C, data types such as char, short, int, and long are defined in terms of their relative sizes. The C standard specifies that:However, the absolute size (in terms of number of bits or bytes) of these types is not fixed by the C standard. For example, the size of an int or short can vary depending on the architecture or the compiler. This flexibility allows C to work across different systems.

sizeof(char) must always be 1 byte (this is guaranteed),

sizeof(short) must be at least as large as sizeof(char),

sizeof(int) must be at least as large as sizeof(short),

sizeof(long) must be at least as large as sizeof(int).

Absolute Size: The actual size in terms of bits can vary by platform. For example, on many modern systems:

char is usually 8 bits,

short is often 16 bits,

int can be 16 or 32 bits (commonly 32 bits nowadays),

long can be 32 or 64 bits (often 64 bits on modern systems).

Technical Point from Your Professor: Your professor is correct in saying that, technically, all of these types could be 9 bits, as long as the relative size constraints are followed. This would be unusual, but C is designed to be flexible and portable across different architectures. The key is that the relative sizes of types must adhere to the standard's requirements, but the absolute size of the types may vary.

However, on the Wikipedia page for C data types:

The actual size of the integer types varies by implementation. The standard requires only size relations between the data types and minimum sizes for each data type:

The relation requirements are that the long long is not smaller than long, which is not smaller than int, which is not smaller than short. As char's size is always the minimum supported data type, no other data types (except bit-fields) can be smaller.

The minimum size for char is 8 bits, the minimum size for short and int is 16 bits, for long it is 32 bits and long long must contain at least 64 bits.

Can someone tell what is correct and perhaps provide a definitive source? Maybe I am misunderstanding something or my professor is working with outdated information.