Number Base Converter

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

Type a number in any field to convert all bases instantly.

Binarybase 2
0b
Octalbase 8
0o
Decimalbase 10
Hexbase 16
0x

Quick Reference (0–15)

Dec
Bin
Oct
Hex
0
0
0
0
1
1
1
1
2
10
2
2
3
11
3
3
4
100
4
4
5
101
5
5
6
110
6
6
7
111
7
7
8
1000
10
8
9
1001
11
9
10
1010
12
A
11
1011
13
B
12
1100
14
C
13
1101
15
D
14
1110
16
E
15
1111
17
F

When a number base converter is the right tool

Use this page to translate a non-negative integer among binary, octal, decimal, and hexadecimal in the browser. Type in one box; the others follow. It is not a floating-point or big-integer converter. For grouping and scientific display of a decimal, see Number Format Converter.

Use cases

Reading a hex value as decimal or binary

Enter FF in Hex (or 255 in Decimal). The binary and octal fields fill in. The 0–15 table under the form is a short nibble cheat sheet, not an input.

Copying a single base

Use Copy on that card. The clipboard gets the digits only — for hex, FF, not 0xFF.

How conversion works

The active field is parsed at its base. If the result is a number greater than or equal to zero, the four representations are written back. Emptying the field you are editing clears all four.

Example — 255 in decimal, binary, octal, and hex
255
11111111
377
FF

What this tool does not do

It does not convert fractions (the decimal point is truncated by parseInt), signed values, or bases other than 2, 8, 10, and 16, and it is not safe for integers past the 53-bit range. Conversion stays in your browser.

How to use Number Base Converter

  1. Type digits into Binary, Octal, Decimal, or Hex — without a 0b / 0o / 0x prefix.
  2. Read or copy the other bases. Use Clear to reset all fields.

Frequently asked questions

How does Number Base Converter work?

Type a non-negative integer in any of the four fields — binary (base 2), octal (base 8), decimal (base 10), or hex (base 16). The other three update as you type. Hex output is uppercase, and the field you are editing is also uppercased. Copy writes that field’s digits only, without a 0b, 0o, or 0x prefix. Those prefixes are labels in the UI, not part of the value.

Should I include 0b, 0o, or 0x in the input?

Usually no. The labels are decoration. parseInt in the browser is used under the hood: 0xFF in the hex box does convert to 255, but 0b10 in the binary box becomes 0 (parsing stops at b), and 0o17 in the octal box becomes 0 for the same reason. Type the digits only.

Why was a “wrong” value accepted, or why did a large number change?

JavaScript parseInt reads a valid prefix and ignores trailing junk, so 19 in octal becomes 1, and 10.5 in decimal becomes 10, without an error. A completely invalid string (for example G in hex) shows “Invalid number for this base.” Conversion uses IEEE-754 numbers, so integers above 2^53−1 (9,007,199,254,740,991) can lose precision. Negatives are rejected.

Is my number uploaded?

No. Conversion runs in your browser. Clear empties all four fields. A 0–15 quick-reference table is shown under the inputs.

Related tools and guides

References

  • Conversion uses the language’s parseInt and Number#toString. That is convenient for everyday integers and is not an arbitrary-precision calculator.