Skip to main content
Byte Array Tools

Integer to Bytes Converter

Convert an integer or a decimal number to its bytes as int8 to int64, uint8 to uint64, float32 or float64, in big-endian and little-endian order.

Enter a number and a type to see the exact bytes a program would write to memory, a file or the network.

float32 cannot store most decimals exactly - the tool shows the nearest value it can hold.

What Is the Integer to Bytes Converter?

It shows the bytes a number becomes when a program stores it as a particular type: int8 to int64, uint8 to uint64, float32 or float64. Both byte orders are shown in hex and decimal.

When to Use It

  • Writing a binary file, a network message or a device command by hand.
  • Checking how a negative number is stored (two's complement).
  • Seeing how precisely a float can store a decimal value.

How to Use It

  1. Enter the number - a whole number, a hex value such as 0xFF, or a decimal for the float types.
  2. Choose the type.
  3. Copy the bytes for the byte order your system uses.

Example

-1000 as an int32 is FF FF FC 18 big-endian and 18 FC FF FF little-endian. 3.14159 as a float32 is 40 49 0F D0 big-endian, and the tool notes that the nearest value a float32 can hold is 3.141590118408203.

Understanding the Output

Negative integers use two's complement, so -1 is all FF bytes in every signed type. Big-endian is also called network byte order; little-endian is what x86 and most ARM processors use in memory.

Limitations

Numbers outside the chosen type's range are rejected with the valid range, rather than wrapped around. Integers up to 64 bits are exact; floats follow IEEE 754 and round to the nearest representable value. To decode bytes back to a number, use Bytes to Integer / Float.

Frequently Asked Questions

Signed integers use two's complement: -1 is all FF bytes, and -1000 as int32 is FF FF FC 18. Unsigned types cannot store negative numbers, so the tool reports an error instead.

Floats store numbers in binary, and most decimal fractions have no exact binary form - just as 1/3 has no exact decimal form. float32 keeps about 7 significant digits; float64 keeps about 15 to 16.

Use big-endian (network byte order) for network protocols and formats that specify it, and little-endian for data written from memory on x86 or ARM machines, or when the file format specifies it.
Share this tool: