Zero Signup ToolsFree browser tools

Developer Tools

Endianness Converter

Swap the byte order of a 16, 32, or 64-bit value between big-endian and little-endian. Paste hex, decimal, or binary and see both orders and the result.

Value and width

Enter the value exactly as it is stored, then pick how many bytes it occupies.

Input base
Width
Swap granularity

Reverse every byte (normal endianness swap).

Byte-order swapped

Swapped (hex)

0x78563412

Swapped (decimal)

2018915346

Swapped bytes

78 56 34 12

Swapped (signed)

2018915346

Both interpretations of your input

The same 4 bytes, read most significant first (big-endian) and least significant first (little-endian).

Big-endian (network order)

Most significant byte stored first. Used by TCP/IP headers, Java, and many file formats.

12[0]
34[1]
56[2]
78[3]

= 0x12345678 (305419896)

Little-endian (Intel order)

Least significant byte stored first. Used by x86, x86-64, most ARM, and RISC-V.

78[0]
56[1]
34[2]
12[3]

= 0x78563412 (2018915346)

Input (hex)

0x12345678

Input (binary)

00010010 00110100 01010110 01111000

How byte-order swaps work

  • Endianness is the order in which the bytes of a multi-byte integer are stored in memory or sent on the wire. It does not change the number, only how its bytes are laid out.
  • Big-endian stores the most significant byte first, so 0x12345678 is laid out as 12 34 56 78. Little-endian stores the least significant byte first, so the same value is 78 56 34 12.
  • A full swap reverses the whole sequence of bytes. Swapping a value twice returns the original, which is why network code converts on send and again on receive.
  • In C the standard helpers are htons and htonl (host to network, a swap on little-endian machines) and ntohs and ntohl (network to host). GCC and Clang also expose __builtin_bswap16, __builtin_bswap32, and __builtin_bswap64.

How to use

  1. Pick the input base: hexadecimal, decimal, or binary. A 0x or 0b prefix in the value overrides this automatically.
  2. Choose the width of the value: 16, 32, or 64 bits, matching how many bytes it occupies in memory.
  3. Type or paste the value exactly as it is stored, with no minus sign.
  4. Read the byte-order swapped result in hex, decimal, and signed form, plus the raw swapped bytes.
  5. Compare the big-endian and little-endian byte arrays of your input to confirm which ordering you have.
  6. Optionally change the swap granularity for half-word or word-swapped layouts, or use the swapped value as the next input to verify a round trip.

About this tool

Endianness Converter swaps the byte order of an integer between big-endian and little-endian and shows both interpretations side by side, so you can fix a value that came out of a file, a packet capture, a register dump, or a binary protocol in the wrong order. Endianness is simply the order in which the bytes of a multi-byte number are stored: big-endian (also called network byte order) keeps the most significant byte first, so 0x12345678 is laid out as 12 34 56 78, while little-endian (the order used by x86, x86-64, most ARM, and RISC-V) keeps the least significant byte first and stores the same value as 78 56 34 12. The number itself never changes; only its byte layout does. Paste a value in hexadecimal, decimal, or binary (a 0x or 0b prefix is detected automatically), choose whether it occupies 16, 32, or 64 bits, and the tool reverses the bytes and reports the swapped value in hex, decimal, and signed two's complement form, along with the raw swapped byte sequence. Below that, the original value is shown as both a big-endian and a little-endian byte array with each byte indexed, so you can see exactly which byte sits where in each ordering. A swap granularity control covers the cases beyond a plain reversal: swap the whole word (the normal endianness flip), swap bytes only within each 16-bit half while keeping the half order, or swap within each 32-bit word, which is the kind of mixed-endian or word-swapped layout some DSPs, fixed-point formats, and legacy hardware use. The value is held internally as a BigInt, so 64-bit inputs stay exact rather than losing precision the way a 53-bit floating-point number would above 2 to the 53. A one-click Use as input button feeds the swapped value back in, which makes it easy to confirm that swapping twice returns the original. The reference panel names the standard C helpers people look for, htons and htonl for host to network order, ntohs and ntohl for the reverse, and the GCC and Clang builtins __builtin_bswap16, __builtin_bswap32, and __builtin_bswap64. This is a byte-order tool, not a full struct unpacker: it operates on a single fixed-width integer, so a value wider than the chosen width is rejected with a clear message rather than silently truncated. Everything runs locally in your browser, so the values you paste, which may come from real captures or memory dumps, are never uploaded or logged.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools