EncryptCodecencryptcodec
Tools/Base Converter

Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal. Supports negative numbers via two's complement and large values via BigInt.

All processing happens in your browser — nothing is sent to our servers

Number Base Systems

Binary (base 2) uses only 0 and 1 — the native language of digital circuits and CPUs. Octal (base 8) groups three binary digits — commonly seen in Unix file permissions (e.g. 755). Decimal (base 10) is the standard human-readable format. Hexadecimal (base 16) groups four binary digits — widely used for memory addresses, colors (#FF0000), and byte values.

How it works
Number Base Conversion
01Input

Number entered in the selected base — binary (0/1), octal (0–7), decimal (0–9), or hexadecimal (0–F)

02Parse

Each digit is multiplied by its positional weight (base^position) and summed to produce an internal BigInt value

03Negative check

If the number is negative, the absolute value is converted and a two's complement representation is computed for the bit visualization

04Base conversion

The BigInt value is divided repeatedly by the target base — remainders form the digits of the output in reverse order

05Format output

Binary grouped in 4-bit nibbles, decimal with thousand separators, hex in uppercase with optional 0x prefix

Spec: IEEE 754 (number representation), ECMAScript BigInt specification

All arithmetic uses JavaScript BigInt — no precision loss regardless of number size.

Frequently Asked Questions