🔄 Endianness Converter – Big-Endian, Little-Endian & PDP-Endian
Endianness describes the order in which bytes of a multi-byte number are stored in computer memory. When two systems with different byte orders exchange binary data — a network packet, a firmware blob, a binary file — the receiving system must reinterpret the bytes in the correct order or the value will be corrupted. This tool converts integers (8-bit through 64-bit) and IEEE 754 floating-point values between Big-Endian, Little-Endian, and PDP (Middle-Endian) byte orders entirely in the browser using the native DataView API — no server round-trip, no external libraries.
What Is Endianness?
Consider the 32-bit hexadecimal value 0x12345678. In memory this value occupies four consecutive bytes at addresses 0x00 through 0x03. The two conventions store those bytes differently:
most significant byte first
Addr 0x00 → 0x12 (MSB)
Addr 0x01 → 0x34
Addr 0x02 → 0x56
Addr 0x03 → 0x78 (LSB)
Used by: TCP/IP, DNS, PowerPC, SPARC, JVM bytecode
least significant byte first
Addr 0x00 → 0x78 (LSB)
Addr 0x01 → 0x56
Addr 0x02 → 0x34
Addr 0x03 → 0x12 (MSB)
Used by: x86, x86-64, ARM (default mode), RISC-V (default)
PDP-Endian (Middle-Endian)
The PDP-11 minicomputer used a third convention: for 32-bit values, the two 16-bit words are stored in big-endian word order, but within each word the bytes are stored in little-endian byte order. So 0x12345678 becomes 34 12 78 56 in PDP-Endian. While this format is mainly of historical interest, it still appears in some embedded systems and legacy industrial protocols.
Supported Data Types
8-bit unsigned / signed integer
16-bit unsigned / signed integer
32-bit unsigned / signed integer
64-bit integer (BigInt precision)
IEEE 754 single-precision floating-point
IEEE 754 double-precision floating-point
Three Conversion Modes
Single Value — the primary mode. Enter a decimal integer, a 0x-prefixed hex literal, or space-separated hex bytes. Select your data type and source/target byte orders, then instantly see the converted value in hex, decimal, octal, and binary alongside a color-coded byte grid that maps each source byte position to its target position.
Raw Hex Bytes — paste any hex byte string (e.g., AA BB CC DD EE FF) to reverse the byte sequence without numeric interpretation. Useful for reversing arbitrary-length fields in binary protocols when the field width does not correspond to a standard integer type.
Batch Mode — enter one value per line (decimal or 0x-prefixed hex) and convert all values in a single pass. Results are displayed in a table and can be exported as a CSV file for use in spreadsheets or test fixtures.
How the Conversion Is Calculated
All conversions use the browser's built-in DataView API. For an integer type, the tool writes the source value into an ArrayBuffer using the source byte order, then reads it back in the target byte order. For example, converting a uint32 from Big-Endian to Little-Endian:
const buf = new ArrayBuffer(4);
const view = new DataView(buf);
view.setUint32(0, 0x12345678, false); // big-endian write
const result = view.getUint32(0, true); // little-endian read
// result === 0x78563412For 64-bit integers, JavaScript's BigInt and DataView.getBigUint64 /getBigInt64 are used to avoid the 53-bit precision ceiling of standard JavaScript numbers. For float32 / float64, setFloat32 / setFloat64 encode the IEEE 754 bit pattern and the bytes are then reordered, so you see exactly how the floating-point value's sign, exponent, and mantissa bytes are laid out in memory for each byte order.
Common Use Cases
- Network protocol debugging — TCP/IP headers use Big-Endian (network byte order); your x86 host uses Little-Endian. Convert port numbers, IP addresses, and length fields before comparing to packet captures.
- Binary file parsing — BMP and WAV use Little-Endian; TIFF, PNG, and ELF support both. Quickly decode field values from a hex dump to verify your parser reads the correct byte order.
- Embedded systems — Microcontrollers communicate via SPI / I²C registers that may use Big-Endian even on a Little-Endian CPU. Convert sensor readings and configuration registers instantly.
- Teaching & learning — The color-coded byte grid makes the concept of byte reordering immediately visual, helping computer-science students grasp the difference between byte orders faster than any diagram.
Accuracy & Limitations
Integer conversions are exact for all supported widths. Float conversions faithfully reproduce the IEEE 754 bit pattern for both float32 and float64; however, a decimal value entered for float32 may be rounded to the nearest representable single-precision value before conversion — this is normal IEEE 754 behavior, not a tool limitation. Very large uint64 values close to 2⁶⁴ − 1 are handled correctly via BigInt, but JavaScript's Number.toLocaleString formatting is bypassed to prevent precision loss.