Positional notation and base conversion
Integers written in base b use digits 0…b−1; each position is a power of b. Developers jump between decimal, binary, and hexadecimal when reading masks, color literals, memory addresses, and permission octals—conversion is the same algorithm with a different radix.
This tool uses arbitrary-precision integers for bases 2–36. For text↔hex of bytes use the Hex encoder; for bit strings use Binary encoder; for KB/MB scaling (not radix) see Byte unit converter.
Radix, digits, and exact integers
How positional base notation works
- The rightmost digit is b⁰, each step left multiplies the place value by b.
- Valid digits in base b are the first b symbols of 0–9 and a–z (case-insensitive input).
- Leading zeros are cosmetic in pure math but sometimes significant in fixed-width hardware fields.
- Fractions need a radix point; this page converts whole integers only.
Binary, octal, decimal, and hexadecimal
- Binary (base 2) maps directly to bits—common for flags and netmasks.
- Octal (base 8) groups three bits per digit—Unix file modes like 755 are octal triplets.
- Decimal (base 10) is the everyday human default.
- Hexadecimal (base 16) packs four bits per digit—0x prefixes in C-like languages strip before parse here.
Big integers and overflow-free conversion
- JavaScript Number is IEEE double—integers above 2⁵³−1 lose precision if you use Number alone.
- Parsing through bigint keeps large constants (64-bit masks, crypto-sized values) exact in the pipeline.
- Output is normalized without leading zeros except the single digit zero.
- Invalid digits for the chosen source base fail fast instead of silently truncating.
Radix vs encoding (hex text of bytes)
- Radix conversion changes how one integer is written—value stays the same abstract number.
- Hex encoding of UTF-8 text produces two nybbles per byte—that is not the same as parsing 0xdeadbeef as one integer.
- Use radix tools for constants; use Hex encoder when the payload is character data.
- Color #RRGGBB is often treated as a 24-bit integer—convert its hex literal here after removing #.
Typical uses
Bit masks and register dumps
Flip between hex constants and binary strings for documentation.
chmod and permission literals
Confirm octal 755 against decimal or binary expansions.