Endian Converter

Big-endian and little-endian bytes for integers and floats, and byte swaps.

About this tool

Choose a mode: Number โ†’ bytes, Bytes โ†’ number, or Swap byte order. For numbers, pick a type (int16, uint32, int64, float32, float64 and so on) and enter a decimal or 0x value. For swaps, choose 16, 32 or 64-bit words. Copy any result.

Big-endian vs little-endian

A multi-byte number has to be stored as a sequence of bytes, and endianness is the order. Big-endian stores the most significant byte first, the way we write numbers. It's the network byte order of TCP/IP and is used by many file formats such as PNG and JPEG headers, Java's DataOutputStream and older CPUs. Little-endian stores the least significant byte first. It's used by x86 and most ARM systems and formats such as BMP, WAV, ZIP and USB descriptors. So 305,419,896 (0x12345678) is 12 34 56 78 big-endian but 78 56 34 12 little-endian. Getting it wrong is a classic bug when parsing binary files, network packets or sensor data: the number comes out wildly different. The converter uses the browser's DataView, so results match what real hardware does. That includes two's-complement negative integers, IEEE 754 floats and exact 64-bit integers via BigInt. Values that don't fit the chosen type wrap or round, with a warning. The hex viewer, the IEEE 754 converter and the number base converter are related, and Binary, explained from zero explains binary.

Frequently asked questions

What is the difference between big-endian and little-endian?

Big-endian stores the most significant byte first, and little-endian the least significant byte first.

Is x86 big-endian or little-endian?

Little-endian. Network protocols (TCP/IP) use big-endian, called network byte order.

How do I swap byte order?

Use Swap mode, paste the hex bytes and choose the word size (16, 32 or 64-bit).

Is my data uploaded?

No. Everything runs in your browser and nothing is stored or sent.