Skip to content
Developer tools

Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal.

Input base
Binary (2)101010
Octal (8)52
Decimal (10)42
Hex (16)2a

How it works

  1. 1Pick the base of your input.
  2. 2Type your number — prefixes (0b, 0o, 0x) are accepted.
  3. 3See the value in every other base, ready to copy.

Use cases

  • Convert color codes and bitmasks during web development.
  • Translate assembly literals between hex and decimal.
  • Verify base-conversion logic in code reviews.

Frequently asked questions

Does it support negative numbers?

Not yet — only non-negative integers. Negative numbers have multiple conventional representations (two's complement at what width?), and we keep this tool focused.

How large can the input be?

No practical limit. BigInt math is used, so numbers wider than 64 bits round-trip exactly.

What about fractional numbers?

Not supported. Base conversion of fractions is a separate problem (and often produces repeating digits).

Read the guide
How to convert between binary, octal, decimal, and hex
The four bases every programmer should be able to translate by feel — and when to reach for a tool instead of doing it in your head.
See all →