Number Base Converter
Type a number into any of the four fields and the other three convert instantly: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). The converter handles arbitrarily large whole numbers, so 64-bit values and beyond stay exact. Everything runs in your browser with nothing sent to a server.
Whole numbers only. Prefixes like 0x, 0b, 0o and separators such as spaces, commas, and underscores are stripped automatically.
How it works
This converter translates whole numbers between the four bases programmers actually use: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Type into any field and the other three update instantly. The active field keeps exactly what you typed, including prefixes like 0x, while the others show the converted value.
The arithmetic uses JavaScript BigInt, which is arbitrary-precision integer math, not floating point. That means a 128-bit value converts exactly, with no silent rounding at the 53-bit limit where ordinary JavaScript numbers lose integer precision. Common notation is cleaned up automatically: 0x, 0b, and 0o prefixes are stripped, as are spaces, commas, and underscore digit separators like 1_000_000.
Each base is just a different way of writing the same quantity. Hex is compact because one hex digit encodes exactly four binary digits, and octal encodes three. That is why permissions on Unix systems are written in octal and memory addresses in hex; this tool lets you move between those notations without mental arithmetic.
How to use it
- Click into the field for the base your number is currently written in.
- Type or paste the number; prefixes like 0x and separators like underscores are stripped automatically.
- Read the other three fields, which convert live as you type.
- Use the Copy button beside any field to copy that representation.
Worked examples
Input: 255 typed into the decimal field
Output: Binary 11111111, octal 377, hexadecimal ff.
255 is the largest value of one byte, which is why it is ff in hex.
Input: 0xDEADBEEF typed into the hexadecimal field
Output: Decimal 3735928559, octal 33653337357, binary 11011110101011011011111011101111.
The 0x prefix is stripped automatically before converting.
Edge cases and limits
- Whole numbers only: fractions, decimal points, and negative signs are not accepted.
- Letters in hex input can be upper or lower case, but converted hex output is shown in lower case.
- There is no two's-complement mode; a binary value is always read as an unsigned magnitude, not as a signed 8, 16, 32, or 64-bit integer.
- Leading zeros in your input are accepted but not preserved in the converted fields.
Common mistakes
- Reading 10 without knowing its base. The string 10 is two in binary, eight in octal, ten in decimal, and sixteen in hex, so always confirm which field you typed into.
- Expecting a negative or fractional conversion. Bases apply to whole-number magnitudes here; signed representations like two's complement are a separate encoding decision.
- Confusing octal 0o17 with decimal 017. Some older languages treat a bare leading zero as octal, which this tool deliberately does not do; use the field, or the 0o prefix, to say what you mean.
Frequently asked questions
How do I convert binary to decimal by hand?+
Multiply each binary digit by the power of two for its position, starting from 2 to the power 0 at the right, then add the results. For example, 1011 is 8 plus 0 plus 2 plus 1, which is 11 in decimal. The converter does the same arithmetic instantly for any length of number.
Why do programmers use hexadecimal instead of binary?+
One hex digit represents exactly four binary digits, so hex is a compact, human-readable shorthand for binary. A 32-bit value needs 32 binary digits but only 8 hex digits, which is why memory addresses, color codes, and byte dumps are conventionally written in hex.
Does the converter handle very large numbers exactly?+
Yes. It uses arbitrary-precision integer arithmetic rather than floating point, so values larger than 64 bits convert without rounding. It accepts whole numbers only; fractions and negative signs are not supported.
What is the largest number the converter can handle?+
There is no fixed limit. BigInt arithmetic grows with the input, so numbers far beyond 64 bits convert exactly. Extremely long inputs of many thousands of digits will still work, just with a brief delay while the page computes.
Related tools
More Developer tools that run entirely in your browser.