Bytes to Int Converter
Convert hex bytes to signed or unsigned integers using big-endian or little-endian byte order.
Paste bytes as spaced hex, comma-separated values, 0x-prefixed bytes, or compact hex.
Unsigned Integer
256Signed Integer
256Bit Width
32-bit00000000 00000000 00000001 00000000Byte Inspection
Offsets count from the first byte you entered. In big-endian order the first byte is the most significant.
| Offset | Hex | Decimal | Binary | ASCII | Significance |
|---|---|---|---|---|---|
| 0x00 | 00 | 0 | 00000000 | · | most significant |
| 0x01 | 00 | 0 | 00000000 | · | |
| 0x02 | 01 | 1 | 00000001 | · | |
| 0x03 | 00 | 0 | 00000000 | · | least significant |
Copy as Byte Array
const bytes = new Uint8Array([0x00, 0x00, 0x01, 0x00]);
// As a hex string:
const hex = "00000100";Documented Fixtures
Real byte patterns from protocols and file formats - click to load:
Value vs Bytes vs Text vs Memory
An integer value is abstract: 256 is 256 everywhere. Serialized bytes are that value written down in an order - big-endian (network protocols, most file formats) puts the most significant byte first; little-endian (x86/x64 memory) puts it last. Endianness changes the byte order, never the abstract integer. Text encoding is a different job entirely: the bytes 32 30 30 are the ASCII characters for "200", not the number 200. Memory representation adds width and sign: the same bytes read as 16-bit or 32-bit, signed or unsigned, give different numbers - which is why this tool lets you fix the width and compare both signed views.
Code Examples
const bytes = [0x00, 0x00, 0x01, 0x00];
const value = bytes.reduce((n, byte) => (n << 8n) + BigInt(byte), 0n);
console.log(value.toString()); // 256Frequently Asked Questions
What is a bytes to int converter?
A bytes to int converter reads a sequence of byte values, combines them in a chosen byte order, and returns the resulting decimal integer.
What is big-endian byte order?
Big-endian stores the most significant byte first. For example, bytes 00 00 01 00 are interpreted as decimal 256 in big-endian order.
What is little-endian byte order?
Little-endian stores the least significant byte first. The same bytes 00 00 01 00 become decimal 65536 when read as little-endian.
Can I convert signed integers?
Yes. The converter shows both unsigned and signed results. The signed value interprets the highest bit as a two's-complement sign bit for the current byte width.
Related Tools
This tool runs entirely in your browser - nothing you enter is uploaded or stored.