Skip to content

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.

Examples

Unsigned Integer

256

Signed Integer

256

Bit Width

32-bit

Hex Value

0x00000100

Parsed Bytes

00 00 01 00
Binary
00000000000000000000000100000000

Big-endian vs little-endian

Big-endian reads the first byte as the most significant byte. Little-endian reads the first byte as the least significant byte. The same bytes can produce different integer values, so choose the byte order used by your file format, protocol, CPU, or API.

Code Examples

const bytes = [0x00, 0x00, 0x01, 0x00];
const value = bytes.reduce((n, byte) => (n << 8n) + BigInt(byte), 0n);
console.log(value.toString()); // 256

Frequently 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