Number Base Converter

Convert numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). All four bases stay synced as you type.

0b
0o
0x

menu_bookQuick Reference

DecBinOctHex
0000
1111
21022
410044
81000108
10101012A
15111117F
16100002010
321000004020
64100000010040
1281000000020080
25511111111377FF

lightbulbTip

Type in any field and all other bases update instantly. Only valid digits for each base are accepted (binary: 0-1, octal: 0-7, hex: 0-9 and A-F).

What is the Number Base Converter?

A number base converter translates an integer between the four bases that show up in computing: binary (base 2, the language of bits), octal (base 8, used in Unix file permissions), decimal (base 10, what humans read), and hexadecimal (base 16, the compact form of binary used for color codes, memory addresses, and byte values).

How to use the Number Base Converter

  1. 1

    Type into any of the four fields

    Drop a number into Decimal, Binary, Octal, or Hex. The other three update on every keystroke.

  2. 2

    Watch the input validation

    Each field rejects invalid characters. Binary accepts 0 and 1, Octal accepts 0-7, Hex accepts 0-9 and A-F.

  3. 3

    Use the prefix as a hint

    Each base shows its prefix (0b, 0o, 0x) as a label, the conventions you'd see in actual code. The input itself doesn't need the prefix.

  4. 4

    Copy the form you need

    Each row has a copy icon. Grab the binary representation for a hardware register, the hex for a color code, the octal for chmod.

Frequently Asked Questions

What number bases are supported?

Four: binary (base 2, digits 0-1), octal (base 8, digits 0-7), decimal (base 10, digits 0-9), hexadecimal (base 16, digits 0-9 and A-F). All four sync live, so changing any one field rewrites the other three.

How large of a number can I convert?

Up to JavaScript's safe integer limit, 2^53 - 1 (9,007,199,254,740,991). Beyond that, JavaScript's number type loses precision and the conversions can't stay exact. For typical use (color codes, file permissions, bit patterns) this is many orders of magnitude more than you need.

Can I type in any base and see all others?

Yes, that's the point. Type into any one of the four fields and the other three rewrite instantly. The active field highlights in primary color so you remember which one is the source of truth.

Related Tools