BYTETOOLS

Endianness Converter

Swap byte order for 16, 32 and 64-bit values. See big-endian and little-endian hex, signed and unsigned decimal, and the float reading.

Both readings of the same bytes

Bytes as given (big-endian)
0x40490FDB
Bytes reversed (little-endian)
0xDB0F4940
Unsigned, big-endian
1078530011
Unsigned, little-endian
3675212096
Signed (two’s complement), big-endian
1078530011
Signed (two’s complement), little-endian
-619755200
IEEE-754 float (binary32), big-endian
3.1415927410125732
IEEE-754 float (binary32), little-endian
-40331460896358400

Whole input with every word byte-swapped

DB0F4940

Non-finite floats are written as nan, inf and -inf. Reading bytes as a float only makes sense when they really were written as one — otherwise the number is meaningless, which is exactly why both readings are shown.

What is the Endianness Converter?

The ByteTools Endianness Converter takes a hex value or a decimal number and shows you both ways the same bytes can be read.

  • 16, 32 and 64-bit word sizes
  • Hex or decimal input, including negative numbers
  • Unsigned and two's-complement signed readings for both orders
  • IEEE-754 half, single and double precision reinterpretation
  • Converts a whole hex blob word by word
  • 100% client-side — values never leave your browser

How to use the Endianness Converter

  1. 1

    Choose the word size — 16, 32 or 64 bits — and whether you are entering hex or a decimal number.

  2. 2

    Paste your value, or a whole hex blob to convert many words at once.

  3. 3

    Compare the big-endian and little-endian readings: hex, unsigned, signed and the IEEE-754 float.

  4. 4

    Copy the fully byte-swapped output, or the table of every word as tab-separated values.

About the Endianness Converter

The ByteTools Endianness Converter takes a hex value or a decimal number and shows you both ways the same bytes can be read. It reverses the byte order for your chosen word size, then reports the big-endian and little-endian hex, the unsigned value, the two's-complement signed value, and the IEEE-754 floating point number those bits represent.

The float reading is the part that usually solves the problem. When a sensor reading or a binary record comes out as an absurd number, seeing the same bytes interpreted as both a big-endian and a little-endian float immediately tells you which way round the producer wrote them. Half, single and double precision are all supported depending on the word size you pick.

Paste a whole hex blob and it is split into words and converted one at a time, with a fully byte-swapped copy of the entire input ready to copy in a single click. Everything runs 100% locally in your browser and nothing is uploaded, so register dumps, firmware fragments and packet captures all stay on your own machine.

Frequently asked questions

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

It is the order bytes are stored in. Big-endian writes the most significant byte first, the way we write numbers by hand, and is the standard for network protocols. Little-endian writes the least significant byte first and is what x86 and ARM processors use internally. The value 0x40490FDB becomes DB 0F 49 40 in little-endian.

How do I know which endianness my data uses?

Try both and see which one is sensible. If a 32-bit value reads as 1078530011 one way and 3682087488 the other, neither helps, but if the float reading gives 3.14159 one way and a tiny exponent the other, you have your answer. That is exactly why every interpretation is shown together.

Why does my float value look completely wrong?

Usually because the bytes were written with the opposite endianness, which the little-endian column will confirm. The other common cause is that those bytes were never a float at all — reading an integer or a string as IEEE-754 produces a meaningless number, often with a huge or tiny exponent.

What do nan and inf mean in the output?

Those are the IEEE-754 special values: not-a-number and infinity. They appear when the exponent bits are all ones, which happens constantly when you reinterpret arbitrary bytes as a float. Seeing them is a strong hint that the data is not floating point, or that the byte order is wrong.

Is my data uploaded when I convert it?

No. The conversion is done in your browser with DataView and BigInt, and the page makes no network requests, so register dumps and packet captures stay on your machine.

Related tools