What are these?
Little and big endian are two ways of storing multibyte datatypes ( int, float, etc). In little endian machines, last byte of binary representation of the multibyte datatype is stored first. On the other hand, in big endian machines, first byte of binary representation of the multibyte datatype is stored first.
Suppose integer is stored as 4 bytes (For those who are using DOS based compilers such as C++ 3.0 , integer is 2 bytes) then a variable x with value 0x01234567 will be stored as following.

Memory representation of integer ox01234567 inside Big and little endian machines
How to see memory representation of multibyte data types on your machine?
Here is a sample C code that shows the byte representation of int, float and pointer.
#include <stdio.h> /* function to show bytes in memory, from location start to start+n*/ void show_mem_rep( char *start, int n) { int i; for (i = 0; i < n; i++) printf ( " %.2x" , start[i]); printf ( "\n" ); } /*Main function to call above function for 0x01234567*/ int main() { int i = 0x01234567; show_mem_rep(( char *)&i, sizeof (i)); getchar (); return 0; } 
When above program is run on little endian machine, gives “67 45 23 01” as output , while if it is run on big endian machine, gives “01 23 45 67” as output.
Is there a quick way to determine endianness of your machine?
There are n no. of ways for determining endianness of your machine. Here is one quick way of doing the same.
C++
#include <bits/stdc++.h> using namespace std; int main() { unsigned int i = 1; char *c = ( char *)&i; if (*c) cout<< "Little endian" ; else cout<< "Big endian" ; return 0; } // This code is contributed by rathbhupendra 
C
#include <stdio.h> int main() { unsigned int i = 1; char *c = ( char *)&i; if (*c) printf ( "Little endian" ); else printf ( "Big endian" ); getchar (); return 0; } 
Output:
Little endian
In the above program, a character pointer c is pointing to an integer i. Since size of character is 1 byte when the character pointer is dereferenced it will contain only first byte of integer. If machine is little endian then *c will be 1 (because last byte is stored first) and if machine is big endian then *c will be 0.
Does endianness matter for programmers?
Most of the times compiler takes care of endianness, however, endianness becomes an issue in following cases.
It matters in network programming: Suppose you write integers to file on a little endian machine and you transfer this file to a big endian machine. Unless there is little endian to big endian transformation, big endian machine will read the file in reverse order. You can find such a practical example here.
Standard byte order for networks is big endian, also known as network byte order. Before transferring data on network, data is first converted to network byte order (big endian).
Sometimes it matters when you are using type casting, below program is an example.
#include <stdio.h> int main() { unsigned char arr[2] = {0x01, 0x00}; unsigned short int x = *(unsigned short int *) arr; printf ( "%d" , x); getchar (); return 0; } 
In the above program, a char array is typecasted to an unsigned short integer type. When I run above program on little endian machine, I get 1 as output, while if I run it on a big endian machine I get 256. To make programs endianness independent, above programming style should be avoided.
What are biendians?
Biendian processors can run in both modes little and big endian.
What are the examples of little, big endian and biendian machines ?
Intel based processors are little endians. ARM processors were little endians. Current generation ARM processors are biendian.
Motorola 68K processors are big endians. PowerPC (by Motorola) and SPARK (by Sun) processors were big endian. Current version of these processors are biendians.
Does endianness affects file formats?
File formats which have 1 byte as a basic unit are independent of endianness e.g., ASCII files . Other file formats use some fixed endianness forrmat e.g, JPEG files are stored in big endian format.
Which one is better — little endian or big endian?
The term little and big endian came from Gulliver’s Travels by Jonathan Swift. Two groups could not agree by which end an egg should be opened a the little or the big. Just like the egg issue, there is no technological reason to choose one byte ordering convention over the other, hence the arguments degenerate into bickering about sociopolitical issues. As long as one of the conventions is selected and adhered to consistently, the choice is arbitrary.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a studentfriendly price and become industry ready.
Recommended Posts:
 Program to count number of set bits in an (big) array
 Count ways to generate pairs having Bitwise XOR and Bitwise AND equal to X and Y respectively
 Generate 0 and 1 with 25% and 75% probability
 SQL  AND and OR operators
 What are the differences between bitwise and logical AND operators in C/C++?
 Find subsequences with maximum Bitwise AND and Bitwise OR
 Count pairs (A, B) such that A has X and B has Y number of set bits and A+B = C
 Code Optimization Technique (logical AND and logical OR)
 Total pairs in an array such that the bitwise AND, bitwise OR and bitwise XOR of LSB is 1
 Why Data Structures and Algorithms are "Must Have" for Developers and Where to learn them : Answered
 Data Structures and Algorithms Online Courses : Free and Paid
 Find two integers A and B such that A ^ N = A + N and B ^ N = B + N
 Maximize the expression (A AND X) * (B AND X)  Bit Manipulation
 Find a number X such that (X XOR A) is minimum and the count of set bits in X and B are equal
 Number of subsets with same AND, OR and XOR values in an Array
 Count subsequences with same values of Bitwise AND, OR and XOR
 Minimum XOR of OR and AND of any pair in the Array
 Maximum Bitwise AND pair (X, Y) from given range such that X and Y can be same
 Construct the Array using given bitwise AND, OR and XOR
 Count of binary strings of length N having equal count of 0's and 1's and count of 1's ≥ count of 0's in each prefix substring