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.
More Byte Array Tools
View all 17float32 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
floatcan store a decimal value.
How to Use It
- Enter the number - a whole number, a hex value such as
0xFF, or a decimal for the float types. - Choose the type.
- 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
Explore More Tools
Keep going with related categories and our most used tools.