Number Base Converter
Free number base converter to convert between binary, octal, decimal and hexadecimal instantly. Pick a source base, enter a value, and see all four bases in your browser.
Updated 2026-06-09 · Free · No sign-up · Runs privately in your browser
Show place-value steps
What is a Number Base Converter?
A number base converter takes one number written in a chosen base and shows the same value in binary, octal, decimal and hexadecimal at the same time. You pick the source base (2, 8, 10 or 16), type your value, and the four outputs update instantly. Enter 255 as decimal and you get 11111111 in binary, 377 in octal and FF in hex. Everything runs locally in your browser.
What does this tool do?
It reads the value in the base you select and re-expresses that single quantity in all four bases at once. Because every base is just a different way of writing the same underlying number, the conversion is exact and fully reversible. The tool also validates your input: it checks that every digit you type is legal for the source base before converting. If a digit is out of range for that base, the value is rejected as invalid rather than turned into a wrong answer, so you always get a correct result or a clear warning.
How does it work?
The method has two stages: parse from the source base, then express in binary, octal, decimal and hexadecimal. A base, also called a radix, is simply how many distinct digits a positional number system uses. Binary (base 2) uses 0 and 1; octal (base 8) uses 0 through 7; decimal (base 10) uses 0 through 9; and hexadecimal (base 16) uses 0 through 9 plus the letters A through F, where A is 10, B is 11, on up to F which is 15.
To convert, the tool repeats this process:
- Parse the input in its source base. Each digit is multiplied by the base raised to its position, then the products are summed into a single whole number. For example, hex
FFis 15 times 16 plus 15, which equals 255. - Validate the digits. Every character must be a legal digit for that base. Binary accepts only 0 and 1, so a
2in a binary input is flagged as invalid. - Express the value in each target base by repeatedly dividing the parsed number by that base and reading the remainders from last to first.
Because the parsed value is one shared number, the four outputs are always consistent with each other. The same 255 that shows as decimal 255 shows as binary 11111111, octal 377 and hex FF in the very same conversion.
Examples
Each example below follows the exact logic above: parse the input in its source base, then express it in binary, octal, decimal and hex.
Example 1 — 255 in decimal across all four bases.
- Set the source base to decimal and enter
255. - The parsed value is 255.
- The tool shows
11111111(binary),377(octal),255(decimal) andFF(hex).
Example 2 — binary 1010 into the other bases.
- Set the source base to binary and enter
1010. - Parsing 1010 in base 2 gives 8 plus 0 plus 2 plus 0, which is 10.
- The outputs are
1010(binary),12(octal),10(decimal) andA(hex).
Example 3 — hex FF back to decimal.
- Set the source base to hexadecimal and enter
FF. - Parsing FF is 15 times 16 plus 15, which equals 255.
- The decimal output reads
255, confirming that hexFFand decimal255are the same value.
Notice that Example 1 and Example 3 describe the same underlying number from two different starting points, which is exactly why a base converter is so useful for checking your work.
Base reference chart
These rows are computed with the same rules as the tool, so you can use the chart as a quick lookup. Each row is one value shown in all four supported bases.
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
The hex row for 10 (which is A) and for 255 (which is FF) lines up with the examples above, and the octal 377 for 255 shows why a single byte is often written as two hex digits or three octal digits.
Common uses
Converting between number bases shows up wherever computing, electronics and math overlap. Typical situations include:
- Developers reading memory addresses, color values or bit flags written in hexadecimal and needing the decimal or binary equivalent while debugging.
- Students and learners working through computer-science or digital-logic homework who need to check that binary
1010really is decimal 10 step by step. - Hardware and embedded engineers translating register values and masks between binary and hex, where a single byte maps cleanly to two hex digits.
- Puzzle and CTF solvers decoding values found in challenges that mix octal, hex and binary representations of the same number.
Tips and common mistakes
A few details cause most confusion when moving between bases:
- Match the source base to your input. If you paste hex
FFwhile the source base is set to decimal, the letters are not legal decimal digits and the value is rejected. Set the base first. - Use only legal digits. Binary accepts only 0 and 1, and octal stops at 7. A stray
2in binary or an8in octal is invalid, not a silent error. - Hex letters go up to F. A through F stand for 10 through 15; there is no
Gdigit. Case does not matter, soffandFFboth mean 255. - Do not include prefixes. Notations like
0xfor hex or0bfor binary are not digits. Enter just the digits themselves, such asFFrather than0xFF. - Same number, different spelling. Binary
1010, octal12, decimal10and hexAare not four different numbers; they are one value written four ways.
Limitations and notes
This converter supports the four most common bases: binary, octal, decimal and hexadecimal. It works with whole, non-negative numbers, since the parse-and-express method reads positional digits in the chosen base. Every digit you type is validated against the source base before conversion, so an illegal digit produces an invalid-input warning rather than a wrong answer. Everything happens locally: the parsing and conversion are plain JavaScript running in your browser, so the value you enter is never uploaded, logged or stored, and the tool keeps working offline once the page has loaded.
For more developer conversions, pair this with the binary translator for text-to-binary work and the hex to rgb converter for color values, or encode data with the base64 encode and decode tool, and browse the full Dev & Tech tools collection.
Frequently asked questions
How do I convert a number between bases?+
Choose the source base (2, 8, 10 or 16), type your value, and the tool instantly shows it in binary, octal, decimal and hexadecimal at once.
What is 255 in binary, octal and hex?+
255 in decimal is 11111111 in binary, 377 in octal and FF in hexadecimal. The tool produces all three from the single decimal input.
What is 1010 binary in decimal?+
Binary 1010 is 10 in decimal and A in hexadecimal. Set the source base to 2, enter 1010, and read the decimal and hex outputs.
What is FF in hex as a decimal number?+
Hexadecimal FF is 255 in decimal. Set the source base to 16, enter FF, and the decimal field shows 255.
Why does binary reject some characters I type?+
Each base only allows its own digits, so binary accepts only 0 and 1. An illegal digit, such as a 2 in binary, is flagged as invalid instead of being converted.
Which bases does this number base converter support?+
It supports the four most common bases: binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16).
Is hexadecimal case sensitive in this tool?+
No. The hex digits A through F can be entered in upper or lower case, and they represent the same values 10 through 15.
Is my number sent to a server when I convert it?+
No. The conversion runs entirely in your browser with JavaScript, so the value you enter never leaves your device and nothing is stored.