Little-endian is a byte order in which a multi-byte value is stored with its least significant byte at the lowest address, first in the file.
Format registries record byte order as a property of a format, with little-endian, big-endian or a selectable value declared in the file itself.
Write the number 305,419,896 in hexadecimal and you get 0x12345678. Store it as four bytes on an Intel PC and a hex dump shows 78 56 34 12. That reversed-looking sequence is little-endian byte order: the least significant byte goes first, at the lowest address. A big-endian system stores the same value as 12 34 56 78.
Neither order is more correct. Byte order matters to file formats because a file outlives the machine that wrote it. A reader on any platform has to know how the writer laid out its integers and floating-point numbers, so every binary format either fixes the byte order in its specification or declares it in the file.
Fixed by the specification
Most formats pick one order and never change it. The choice usually follows the hardware the format was designed on.
- Little-endian: BMP, WAV and AVI (RIFF), ZIP, PE executables on Windows, most of the structures in FAT file systems.
- Big-endian: PNG, JPEG, Apple’s AIFF, the Java class file and most network protocols (where big-endian is called network byte order).
GIF, a format people tend to guess wrong, stores its dimensions little-endian. The rule of thumb about origins has exceptions, and the specification is the only reliable source. RIFF even has a big-endian sibling, RIFX, which differs only in its first FourCC and the order of every number that follows.
Declared in the file
Some formats let the writer choose and put the answer in the header. TIFF is the textbook case. Its first two bytes are either 49 49 (“II”, for Intel, little-endian) or 4D 4D (“MM”, for Motorola, big-endian). The next two bytes hold the number 42, which itself appears in the chosen order: 2A 00 after “II”, 00 2A after “MM”. Many camera raw formats built on TIFF inherit the same switch.
For identification, a selectable byte order means two signatures. A tool looking only for 49 49 2A 00 misses every big-endian TIFF, which is why registries describe TIFF with both patterns and why byte order belongs in the format record as a property with three possible values: little, big or selectable. The file format identification guide covers how such alternative signatures are written.
Text, Unicode and the byte order mark
Text formats avoid the issue as long as each character fits in one byte, so ASCII, Latin-1 and UTF-8 have no byte order. UTF-16 and UTF-32 do. A UTF-16 file can start with the byte order mark U+FEFF: stored as FF FE it signals little-endian, as FE FF big-endian. Windows tools have long written little-endian UTF-16 with a BOM, which is why a “Unicode” text file saved by an old version of Notepad starts with FF FE.
When byte order goes wrong
Errors are easy to spot once you know the pattern. A width of 640 pixels (0x0280) read in the wrong order becomes 32,770 (0x8002), and audio samples read with the wrong byte order play back as loud noise. Floating-point data is less forgiving: swapped bytes usually still form a valid number, just a meaningless one, so a dataset can look plausible while being wrong. For scientific data written by older Fortran or C programs without a self-describing header, recording the byte order of the writing machine is part of keeping the file readable. Related concepts are listed in the vocabulary index.
Example in RDF
value 0x12345678
little-endian 78 56 34 12
big-endian 12 34 56 78
TIFF header, little-endian: 49 49 2A 00 ("II", 42)
TIFF header, big-endian: 4D 4D 00 2A ("MM", 42)
Questions about Little-endian
What does little endian mean?
It means the least significant byte of a number comes first. The 32-bit value 0x12345678 is written as 78 56 34 12. Big endian does the opposite and writes 12 34 56 78, the order in which people normally read hex.
Where do the words little endian and big endian come from?
From Jonathan Swift's Gulliver's Travels, where two factions fight over which end of a boiled egg to crack. Danny Cohen borrowed the terms in his 1980 note 'On Holy Wars and a Plea for Peace' about byte order in network protocols.
Is x86 little endian?
Yes. Intel and AMD x86 processors are little endian, and ARM processors almost always run in little-endian mode. That is one reason so many Windows-era formats, such as BMP and WAV, store their numbers little endian.
Does byte order matter for text files?
For single-byte encodings such as ASCII and UTF-8, no. For UTF-16 and UTF-32 it does, which is why those files often begin with a byte order mark: FF FE signals little-endian UTF-16, FE FF big-endian.
Which common formats are little endian?
BMP, WAV and AVI (all RIFF-based or Windows-derived), ZIP, and the x86 executable formats store numbers little endian. PNG, JPEG, AIFF and Java class files are big endian. TIFF and some camera raw formats allow both.