Endianness / Byte-Order Swapper — Big-Endian ⇄ Little-Endian Hex Converter
Swap a value between big-endian and little-endian byte order. Enter a hex (with or without 0x) or decimal value, choose 16, 32 or 64-bit width, and see the byte layout, both hex forms and both unsigned decimal interpretations — live, in your browser, with click-to-copy.
How to Use
- Type a value in hex (0x optional) or switch the input to decimal.
- Pick the width — 16-bit (2 bytes), 32-bit (4 bytes) or 64-bit (8 bytes).
- Read the byte boxes left-to-right, then watch them reverse for the opposite endianness.
- Click any hex or decimal value (or its Copy button) to copy it.
Big-endian and little-endian, side by side
Every multi-byte number has to be laid out as an ordered sequence of bytes before it is stored in memory, written to a file or sent over a network. Endianness is simply the rule that decides that order. Big-endian stores the most-significant byte first — the same direction we write numbers, so 0x12345678 is laid out 12 34 56 78. Little-endian stores the least-significant byte first, so the very same value becomes 78 56 34 12. This tool takes one value, splits it into bytes for the width you pick, and shows both orderings together: the byte boxes, both hex forms, and the two unsigned decimal numbers you would read back. Everything runs in your browser — nothing is uploaded.
How the swap is computed
The algorithm is deliberately simple, which is exactly why byte order is so easy to get wrong by hand. First the value is padded to the full width in hexadecimal — two hex digits per byte, so a 32-bit value is always eight hex digits. Those hex digits are then sliced into bytes of two characters each. To swap endianness, you reverse the byte list and join it back together; nothing else changes. Because reversing a list twice restores the original order, byte-swapping is its own inverse — swap 0x12345678 to 0x78563412 and swap again and you are back where you started. Reading each ordering back as an unsigned integer gives two different decimal numbers, which is why a swapped value looks unrelated even though it is built from the identical four bytes. For 64-bit widths the tool uses BigInt so values up to 0xFFFFFFFFFFFFFFFF stay exact.
Where you meet each byte order
Little-endian is what most hardware uses internally: x86, x86-64 and the common ARM configurations all store integers least-significant-byte-first, as do file formats such as BMP, WAV, and ZIP. Big-endian — historically called the Motorola order — survives as network byte order in TCP/IP, so a TCP port or an IPv4 address travels most-significant-byte-first, and it is used by PNG, JPEG, and TIFF files tagged MM. The C functions htons/htonl (host-to-network) and ntohs/ntohl (network-to-host) are exactly this swap on little-endian machines, and CPUs expose a dedicated BSWAP instruction to do it in one step.
Quick reference
About the Endianness / Byte-Order Swapper — Big-Endian ⇄ Little-Endian Hex Converter
Working on everyday tasks? The Endianness / Byte-Order Swapper — Big-Endian ⇄ Little-Endian Hex Converter is a free browser tool that gives you the answer in seconds. Swap a value between big-endian and little-endian byte order. Enter a hex (with or without 0x) or decimal value, choose 16, 32 or 64-bit width, and see the byte layout, both hex forms and both unsigned decimal interpretations — live, in your browser, with click-to-copy.
How it works
Enter a number and choose your units — the converted value shows instantly. Everything runs locally, so nothing you type leaves your device. Double-check the direction of the conversion and you are set.
Want the deeper story? The Knowledge Base explains the ideas behind the tools in more detail.
Frequently Asked Questions
What is endianness?
Endianness is the order in which a multi-byte value is stored in memory or sent over a wire. Big-endian puts the most-significant byte first (the way we write numbers); little-endian puts the least-significant byte first. The value is identical — only the byte ordering differs. x86/x64 and most ARM are little-endian; network protocols (TCP/IP) and many file formats are big-endian ("network byte order").
How do I swap byte order by hand?
Pad the value to the full width in hex (4 hex digits per 16 bits), split it into bytes of two hex digits each, then reverse the byte list. So 0x12345678 (bytes 12 34 56 78) becomes 78 56 34 12 = 0x78563412. Swapping a second time returns the original — byte reversal is its own inverse.
Why does the little-endian decimal look so different?
Because reordering the bytes produces a genuinely different number when read back as an integer. 0x12345678 is 305419896 in decimal; its byte-swapped form 0x78563412 is 2018915346. The bytes are the same set, but their place values changed.
Does this handle 64-bit values exactly?
Yes. 64-bit math uses JavaScript BigInt, so a full 0xFFFFFFFFFFFFFFFF is exact with no floating-point rounding.
Is anything uploaded?
No. The whole conversion runs locally in your browser with JavaScript — nothing is sent to a server.
How do I use the Endianness / Byte-Order Swapper — Big-Endian ⇄ Little-Endian Hex 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
Network programming
Convert host byte order to/from network byte order (htons/htonl/ntohl) when reading packet headers, ports or IPv4 addresses.
Binary file & format work
Reconcile a value when a format stores it little-endian (BMP, WAV, ZIP) versus big-endian (PNG, JPEG, TIFF "MM").
Embedded & firmware
Match the byte order an MCU, bus or peripheral register expects, and decode hex dumps that came out reversed.
Reverse engineering
Read multi-byte values straight out of a little-endian memory dump without juggling the bytes in your head.
Last updated: