Base Converter (Bin/Oct/Dec/Hex)

Convert any integer between binary (2), octal (8), decimal (10), and hexadecimal (16).

Inputs

Result

Loading calculator…

How to use this calculator

  • Enter value (with or without 0x/0b prefix).
  • Pick the base of the input.
  • Read all four common bases.

About this calculator

Number bases (radices) express the same integer with different digit symbols. Binary (base 2): only 0 and 1, foundation of digital computers. Hex (base 16): 0-9, A-F, used for memory addresses and color codes. Octal (base 8): rare today except Unix file permissions. Conversion is mechanical: parse from any base, output in any. JavaScript built-ins handle bases 2-36.

Frequently asked

Why hex?+
Each hex digit = 4 bits. 8-bit byte = 2 hex digits (00 to FF). Easier to read than long binary strings.
Color hex code?+
#RRGGBB — 3 hex bytes. #FF0000 = pure red, #00FF00 = green, #0000FF = blue, #FFFFFF = white.
Octal still used?+
Mostly Unix file permissions (chmod 755). Otherwise rare. C uses leading 0 for octal literals (0755).
Negative numbers?+
Use two's complement representation. JS Number's toString gives a minus sign instead. This calc covers integers ≥ 0.
Bigger than 32-bit?+
JS Number handles up to 2^53. For arbitrary-precision, use BigInt and BigInt.toString(base).

Related calculators

More tools you might like

Hand-picked tools that pair well with this one — same audience, same intent.