Free developer number converter

Binary Decimal Hex Converter

Convert unsigned integer values between binary, decimal, hexadecimal, and octal, then inspect simple byte values for ASCII and debugging work.

  • Binary
  • Decimal
  • Hexadecimal
  • Octal

Number input

Convert between number bases

This first version is intentionally focused on unsigned whole-number conversion. It avoids signed integer and two's complement assumptions so the result is clear.

Converted result

Base conversion

Input typedecimal input
Binary
1111 1111
Decimal
255
Hexadecimal
0xFF
Octal
0o377
Bit length
8 bits

Byte helper

Inspect one byte

Enter a decimal byte from 0 to 255 to see its printable character, 8-bit binary value, hex value, and decimal value.

Character
A
Binary
01000001
Hex
0x41
Decimal
65

How base conversion works

A number base describes how many symbols are used to write a value. Decimal uses ten symbols, binary uses two, octal uses eight, and hexadecimal uses sixteen. The value is the same number, but the written representation changes.

For example, decimal 255 is binary 11111111, hexadecimal FF, and octal 377. Developers and network engineers switch between these formats when reading byte values, masks, flags, memory addresses, and protocol data.

Why hexadecimal is common

Hexadecimal is compact because one hex digit maps cleanly to four binary bits. That makes it easier to inspect binary data without reading a long string of ones and zeroes.

You see hex in color codes, MAC addresses, packet captures, hashes, byte dumps, memory addresses, and debugging output.

Binary, decimal, octal, and hex compared

Each base writes the same numeric value with a different set of symbols. The right display depends on what you are trying to inspect.

Base Symbols Common use
Binary, base 2 0 and 1 Bits, masks, flags, and low-level debugging.
Octal, base 8 0 through 7 Unix permissions and compact legacy notation.
Decimal, base 10 0 through 9 Human-readable counts and everyday arithmetic.
Hexadecimal, base 16 0-9 and A-F Bytes, colors, memory, packet captures, and hashes.

Common base prefixes

Programming tools often use a short prefix to show which base a number is written in. Prefixes are display hints; they do not change the underlying value.

Prefix Base Example
0b Binary 0b1010 = 10
0o Octal 0o12 = 10
none Decimal 10 = 10
0x Hexadecimal 0xA = 10

Binary and byte boundaries

Binary values are often grouped in fours or eights because that lines up with hex digits and bytes. This converter groups long binary output so the result is easier to scan.

The byte helper focuses on one 8-bit value at a time. Values from 32 through 126 are printable ASCII characters, while lower control values and higher extended byte values may not show as normal text.

Useful bit-width reference

When code, hardware, or a protocol expects a fixed width, leading zeroes can matter. Decimal 15 is still 15, but it may need to be displayed as 00001111 in an 8-bit field.

Width Maximum unsigned decimal Maximum hex
8-bit byte 255 0xFF
16-bit word 65,535 0xFFFF
32-bit unsigned 4,294,967,295 0xFFFFFFFF
64-bit unsigned 18,446,744,073,709,551,615 0xFFFF...FFFF

Common conversion mistakes

Common mistakes include confusing the written base with the actual value, dropping leading zeroes when a fixed byte width matters, or assuming every byte maps to a printable character. When exact width matters, keep track of whether you need 8-bit, 16-bit, 32-bit, or 64-bit output.

This tool focuses on unsigned whole numbers. Signed integers, negative values, and two's complement interpretation depend on the bit width and language or protocol rules, so verify those separately when debugging production code.

Methodology, Formula & Official Standards

This positional radix converter translates unsigned and byte-aligned integers across Binary (base 2), Octal (base 8), Decimal (base 10), and Hexadecimal (base 16) using arbitrary-precision BigInt positional expansion: Value = sum(d_i × b^i), where b is the base (2, 8, 10, or 16) and d_i is the digit value at position i. In accordance with IEEE 754 / ISO/IEC 9899 (C99 stdint.h) and NIST digital data representation standards, each hexadecimal digit maps to an exact 4-bit nibble (2^4 = 16) and each octal digit maps to a 3-bit triad (2^3 = 8), eliminating floating-point precision loss above 2^53 - 1.

Step-by-Step Worked Example

Worked Example: Convert the 16-bit unsigned decimal port/memory value 49,152 into binary, hexadecimal, and octal. Dividing by powers of 16 gives 49,152 = 12 × 16^3 + 0 × 16^2 + 0 × 16^1 + 0 × 16^0, where 12 maps to hex digit C, yielding 0xC000. Expanding each hex nibble into 4 bits (C = 1100, 0 = 0000) yields the 16-bit binary representation 1100000000000000_2. Grouping those 16 bits from right to left into 3-bit octal triads (001 100 000 000 000 000) yields 0o140000.

Reference Benchmark & Comparison Table: Standard Unsigned Integer & Bit-Width Radix Reference Table (IEEE / ISO C99 stdint.h)

Bit Width / TypeDecimal Range (Unsigned)Hexadecimal MaxBinary Bit Pattern (Max)Common Systems Engineering Use
4-bit Nibble0 to 150xF1111Single hex digit, BCD encoding, IPv4 header IHL
8-bit Byte (uint8_t)0 to 2550xFF11111111ASCII/UTF-8 code unit, IPv4 octet, RGB color channel
16-bit Word (uint16_t)0 to 65,5350xFFFF16 ones (2 bytes)TCP/UDP port numbers, Unicode BMP code point
32-bit Dword (uint32_t)0 to 4,294,967,2950xFFFFFFFF32 ones (4 bytes)IPv4 address space, CRC32 checksum, FAT32 limit
64-bit Qword (uint64_t)0 to 18,446,744,073,709,551,6150xFFFFFFFFFFFFFFFF64 ones (8 bytes)CPU registers, ZFS/ext4 inode addressing, Unix ns timestamps

Frequently Asked Questions

Why do programmers use hexadecimal (base 16) instead of binary?

Because 16 is an exact power of 2 (2^4), every single hexadecimal digit (0–9, A–F) represents exactly 4 binary bits (a nibble), and two hex digits represent exactly 1 byte (8 bits). This compresses 32-bit binary strings into 8 readable hex characters.

Why does standard JavaScript lose accuracy on large integers above 9,007,199,254,740,991?

Standard IEEE 754 double-precision floats only have 53 bits of significand precision (Number.MAX_SAFE_INTEGER = 2^53 - 1). This converter uses native arbitrary-precision BigInt arithmetic so 64-bit and 128-bit values convert without rounding errors.

How are octal (base 8) numbers used in Linux and Unix file permissions?

POSIX chmod permissions group read (4), write (2), and execute (1) bits into three 3-bit octal digits for owner, group, and others—for example, rwxr-xr-x binary 111 101 101 converts directly to octal 755.

What do the prefixes 0b, 0o, and 0x mean in source code?

Across C, Python, JavaScript, Rust, and Go, 0b denotes a binary literal (0b1010 = 10), 0o denotes an octal literal (0o755 = 493), and 0x denotes a hexadecimal literal (0xFF = 255).

Editorial Methodology & Disclaimer

Editorial Methodology & Disclaimer: All calculator outputs and reference tables on Utility Stack are educational planning estimates based on published mathematical standards. They are not professional financial, legal, tax, or medical advice.