Logo

MonoCalc

/

Endianness Converter

Encode/Decode

Source bytes (Big-Endian)

[0]

12

[1]

34

[2]

56

[3]

78

↓ byte order converted ↓

Result bytes (Little-Endian)

[0]

78

[1]

56

[2]

34

[3]

12

Hexadecimal

0x78563412

Decimal (unsigned)

305419896

Octal

0o2215053170

📡 Common Byte Orders

Big-Endian

TCP/IP, DNS, HTTP/2

Little-Endian

x86, x86-64, ARM (LE)

Big-Endian

PowerPC, SPARC, JVM

Little-Endian

USB, PCIe

Big-Endian

MIDI protocol

PDP-Endian

PDP-11 minicomputer

About This Tool

🔄 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:

Big-Endian

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

Little-Endian

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

uint8 / int81 byte

8-bit unsigned / signed integer

uint16 / int162 bytes

16-bit unsigned / signed integer

uint32 / int324 bytes

32-bit unsigned / signed integer

uint64 / int648 bytes

64-bit integer (BigInt precision)

float324 bytes

IEEE 754 single-precision floating-point

float648 bytes

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 === 0x78563412

For 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.

Frequently Asked Questions

Is the Endianness Converter free?

Yes, Endianness Converter is totally free :)

Can I use the Endianness Converter offline?

Yes, you can install the webapp as PWA.

Is it safe to use Endianness Converter?

Yes, any data related to Endianness Converter only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does the Endianness Converter work?

Enter a numeric value or hex byte string, select your data type (uint8 through float64), choose the source and target byte orders, then click Convert. The tool uses the browser's DataView API to reinterpret the bytes and shows the result in hexadecimal, decimal, binary, and a color-coded byte grid.

What is the difference between Big-Endian and Little-Endian?

In Big-Endian order the most-significant byte is stored at the lowest memory address — used by network protocols (TCP/IP), PowerPC, and SPARC. In Little-Endian order the least-significant byte comes first — used by x86, x86-64, and ARM in its default mode. The value 0x12345678 is stored as [12 34 56 78] in Big-Endian and [78 56 34 12] in Little-Endian.

What is Middle-Endian (PDP-Endian) byte order?

Middle-Endian (also called PDP-Endian) is a mixed byte order historically used by the PDP-11 minicomputer. For a 32-bit value, the two 16-bit words are stored in big-endian word order but each word is stored in little-endian byte order. For example, 0x12345678 becomes [34 12 78 56] in PDP-Endian.

How are float32 and float64 values converted?

The decimal value is encoded as an IEEE 754 floating-point number in memory, then the bytes are reordered according to the target byte order using the DataView API. The raw hex memory layout for both byte orders is displayed alongside the decimal value, helping you debug binary protocol fields.

Can this tool handle 64-bit integers without precision loss?

Yes. The converter uses JavaScript's BigInt arithmetic and DataView.getBigUint64 / getBigInt64 methods internally, which avoid the 53-bit precision ceiling of standard JavaScript numbers. You can safely convert uint64 values up to 2⁶⁴ − 1.

When would I need to convert byte order?

Byte-order conversion is needed when reading binary file formats (BMP, ELF, WAV), parsing network protocol headers (IP, TCP, DNS), interfacing with embedded sensors or microcontrollers, writing cross-platform serialisation code, or debugging memory dumps from a CPU architecture different from your development machine.