Endianness Converter
Swap the byte order of a 16, 32 or 64-bit value and see how it sits in memory as big-endian and little-endian, or read bytes from a memory dump as a number in either order.
How to Use
- Choose value to bytes to see how a number is laid out in memory, or bytes to value to read a memory or file dump.
- Pick the width: 16, 32 or 64 bits.
- Type the value (hex by default, or switch to decimal), or the bytes in memory order, such as 78 56 34 12.
- For bytes to value, say whether the data is big-endian or little-endian.
- Read the byte-swapped value and both byte orders; the drawing colours each byte so you can follow it.
Worked Example
0x12345678 in memory. The value has four bytes, 12, 34, 56 and 78, with 12 the most significant. A big-endian machine stores them in that order from the lowest address: 12 34 56 78. A little-endian machine, such as any x86 PC, stores the least significant byte first: 78 56 34 12. Read as a big-endian number, those little-endian bytes would be 0x78563412 = 2,018,915,346, which is why swapping is needed between the two.
Reading a little-endian dump. A BMP file header shows 80 02 00 00 for the image width. BMP is little-endian, so reverse the bytes: 0x00000280 = 640 pixels.
The common mistake: reversing the hex digits. Byte swapping reverses whole bytes, not single digits. 0x12345678 becomes 0x78563412, not 0x87654321. Each byte keeps its two digits in order.
Show Work
Formulas
Holy Wars Over Byte Order
Neither order is objectively better. Big-endian matches how we write numbers and makes hex dumps easy to read; little-endian lets a program read the low byte of a value at the same address whatever its size, which simplified early processors such as the Intel 8080 and 8086. IBM’s System/360 and Motorola’s 68000 chose big-endian, Intel little-endian, and the DEC PDP-11 managed a mix of the two.
Danny Cohen’s 1980 memo “On Holy Wars and a Plea for Peace” named the camps after the egg-cracking factions of Gulliver’s Travels and argued that the only thing that matters is agreeing on one. Internet standards settled on big-endian, which is why it is still called network byte order, while little-endian x86 and ARM came to dominate computers.
About This Calculator
This converter shows how a 16, 32 or 64-bit value is laid out in memory as big-endian and little-endian (and PDP-11 order for 32-bit values), gives the byte-swapped value in hex and decimal, and reads raw bytes from a dump as a number in either byte order. The drawing colours each byte so you can follow where it goes.
Everything runs in your browser; nothing is sent anywhere. To reverse the bits inside a value rather than its bytes, use the bit manipulation toolkit.
Related calculators: Bit Manipulation Toolkit, Number Base Converter, and Hex Editor.
Frequently Asked Questions
What is endianness?
The order in which the bytes of a multi-byte number are stored. Big-endian puts the most significant byte first, at the lowest address, the way we write numbers: 0x12345678 is stored 12 34 56 78. Little-endian puts the least significant byte first: 78 56 34 12. The value is the same; only the layout in memory differs.
Which computers are little-endian?
Almost all current ones: x86 and x86-64 processors are little-endian, and ARM and RISC-V are normally run little-endian too. Big-endian survives in IBM mainframes and POWER systems, older SPARC and Motorola 68000 machines, and in network protocols.
What is network byte order?
Big-endian. Internet protocols send multi-byte fields most significant byte first, so a little-endian computer must swap bytes going out and coming in, using htons and htonl (host to network) and ntohs and ntohl. Port 8080 is 0x1F90, sent as the bytes 1F 90.
Does endianness affect bits within a byte?
Not for memory: a byte is the smallest addressable unit, so its bit order is not visible in memory and byte swapping never reverses bits. Bit order does matter on serial links, where some send the least significant bit first; the bit manipulation toolkit can reverse bits.
Where do the names come from?
From Gulliver’s Travels, where the people of Lilliput go to war over whether to crack a boiled egg at the big end or the little end. Danny Cohen borrowed the names in his 1980 note “On Holy Wars and a Plea for Peace”, about byte order in network protocols.
How do I use the Endianness Converter?
Simply type or paste your value and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Memory dumps
The bytes 78 56 34 12 in a little-endian dump are the value 0x12345678.
Networking
Port 8080 (0x1F90) goes on the wire as 1F 90; on x86 it sits in memory as 90 1F.
File formats
A BMP width of 0x00000280 (640) appears in the file as 80 02 00 00.
Byte swapping
0xCAFE swaps to 0xFECA; 0x12345678 swaps to 0x78563412.
Last updated: