Convert to and from Bin, Oct, Dec, Hex & other numeral systems

This script converts numbers from the decimal system (base/radix 10) to other positional systems and vice versa:

  • Binary (base 2, bin, bit)
  • Ternary (base 3, trit)
  • Quaternary (base 4)
  • Octal (base 8, oct)
  • Duodecimal (base 12)
  • Hexadecimal (base 16, hex, nibble)
  • Vigesimal (base 20)
  • Base 36

This tool will autodetect C/Java hex numbers starting with '0x' and binary numbers starting with '0b'.

Input:

 

Note on Negative Numbers & Fractions

Negative Numbers
This tool uses Sign-Magnitude (mathematical) representation (e.g., -10 = -1010 in binary).
It does not use computer-centric Two's Complement (where -1 would look like 1111 in binary), as that requires a fixed bit-width (8, 16, 32, 64-bit) to be defined.

Fractions & Precision
Converting fractions (like 0.1) between bases often results in infinite repeating sequences in binary or hex. This tool limits fractional output to 10 digits to stay within reliable floating-point precision.