Swap a value between big-endian and little-endian byte order. The bytes reverse; the bits inside each byte do not – the classic trap when reading hex dumps and network captures.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Byte order, made visible
Multi-byte values have no single memory layout: big-endian machines store the most significant byte first, little-endian machines the least. The VALUE is identical; the byte sequence differs — and mixing the two up is among the oldest interoperability bugs in computing.
This converter splits a value into bytes, shows both orders, and gives the byte-swapped value — with the crucial invariant stated every time: bytes reverse, bits within each byte do not.
Worked example
Value: 0x12345678 (32-bit) Big-endian bytes: 12 34 56 78 (network order) Little-endian bytes: 78 56 34 12 (x86 memory) Byte-swapped value: 0x78563412
Where each order lives
Network protocols standardise big-endian (hence htonl/ntohl); x86 and most ARM deployments are little-endian; file formats pick one and document it — or carry a byte-order mark, like UTF-16’s FEFF. Reading a dump with the wrong assumption produces plausible-looking nonsense, which is what makes the bug class so durable.
Spotting a swap in the wild
Magic numbers are the tell: TIFF begins II or MM declaring its order; a PNG’s length fields read absurdly large under the wrong assumption; timestamps land decades away. When a parsed value looks crazy by a factor with byte symmetry, swap first, debug second.
Privacy
Splitting and reversing happen locally; values are never transmitted.
How to use the Endianness Converter
- Enter a hex value and choose its width – 16, 32 or 64 bits.
- Click "Swap byte order".
- You see the big-endian byte sequence, the little-endian sequence, and the byte-swapped value.
- The steps stress the key invariant: bytes reverse, bits inside each byte do not.
Frequently asked questions
What is the difference between big- and little-endian?
Storage order of a multi-byte value: big-endian puts the most significant byte at the lowest address (network order); little-endian puts the least significant byte first (x86, most ARM configurations). 0x12345678 stores as 12 34 56 78 or 78 56 34 12 respectively.
Why do the BITS not reverse?
Endianness is a byte-addressing phenomenon – memory is addressed per byte, so only byte order varies. Each byte's internal bit significance is fixed by the arithmetic. Reversing bits would be a different (and rarely wanted) transformation.
When do I actually need a byte swap?
Reading network protocols on little-endian hosts (ntohs/ntohl territory), parsing binary file formats with a declared endianness, cross-platform serialization, and interpreting raw memory dumps from a different architecture.
How can I tell a file's endianness?
Look for a known magic number: if a format's magic 0x4D4D or 0x4949 (TIFF) appears reversed, you are reading with the wrong assumption. Some formats carry an explicit byte-order mark – UTF-16's FEFF/FFFE being the famous one.
Does endianness affect single bytes or text?
No – single-byte values and ASCII/UTF-8 byte streams are endianness-free, which is one of UTF-8's design advantages over UTF-16.
What does the width option change?
How many bytes participate in the swap: the same digits pad to 2, 4 or 8 bytes first, and the reversal differs accordingly – a 32-bit swap of 0x1234 is 34 12 00 00 reversed to 00 00 34 12, not just two bytes.
Is the swap computed locally?
Yes – byte splitting and reversal run in the page. Values are never transmitted.