Arduino Standard Variable Types

char

-128 to 127 (8-bit)

byte

0 to 255 (8-bit)

int

ATMega based boards (e.g. Arduino Uno)

-32,768 to 32,767 (16-bit)

Arduino Due and other 32bit boards

-2,147,483,648 to 2,147,483,647 (32-bit)

unsigned int

ATMega based boards (e.g. Arduino Uno)

0 to 65,535 (16-bit)

Arduino Due and other 32bit boards

0 to 4,294,967,295 (32-bit)

long

-2,147,483,648 to 2,147,483,647 (32-bit)

unsigned long

0 to 4,294,967,295 (32-bit)

float

-3.4028235E+38 to 3.4028235E+38
6-7 decimal digits of precision (total number of digits, not the number to the right of the decimal point)
32 bits (4 bytes)

double

ATMega based boards (e.g. Arduino Uno)

No different to a float (this is non-standard – unlike other platforms where you can get more precision by using a double.

Arduino Due and other 32bit boards

64 bits (8 bytes)

 

 

UK Electronic Designer
USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.