All four bases at once
One entry shows the value in binary, octal, decimal and hexadecimal together, so you never convert in steps.
This number base converter switches a whole number between binary, octal, decimal and hexadecimal.
Loading tool…
The tool is loading its code on your device. This happens once and is cached for later visits.
Processed entirely on your device
Overview
A number base converter for binary, octal, decimal and hexadecimal — type a whole number and see the same value written out in all four bases at once.
This number base converter switches a whole number between binary, octal, decimal and hexadecimal instantly. Number bases are just different ways to write the same quantity. Enter a value, tell the converter which base it is in, and it shows the equivalent in binary, octal, decimal and hexadecimal all at once.
decimal 255 = 2·100 + 5·10 + 5·1
binary 11111111 = 128+64+32+16+8+4+2+1
hex FF = 15·16 + 15·1Every base works the same way — each digit is worth the digit times the base raised to its position.
One hexadecimal digit covers exactly four binary bits, so FF is 11111111. That is why hex is the shorthand of choice for colours, memory addresses and byte values.
Entering 255 in decimal:
binary 11111111 = 128+64+32+16+8+4+2+1
octal 377 = 3×64 + 7×8 + 7×1 = 192+56+7
hex FF = 15×16 + 15×1 = 240+15
bits 8Every line is the same quantity, which is the whole point of the tool. Run it the other way and 11111111 typed as base 2 returns 255, FF typed as base 16 returns 255, and 377 typed as base 8 returns 255.
A power of two shows the pattern even more clearly. 1024 is 10000000000 in binary — a single 1 followed by ten zeros, needing 11 bits — 2000 in octal and 400 in hexadecimal. Each trailing zero digit is one more factor of the base.
Every base is validated against its own digit set, so a mistake is caught rather than quietly reinterpreted:
A leading 0x or 0X is stripped to match how hex is written in code, so 0xFF, FF and ff all give 255. Underscores and spaces inside the value are removed too, which keeps grouped digits readable: 1111_1111 and FF FF both parse.
Only non-negative whole numbers are supported. Negatives are refused, and so are fractions — and that is not an arbitrary restriction. 0.1 has no exact binary representation at all, being the infinitely repeating 0.0001100110011…, which is the same reason decimal money arithmetic goes wrong in floating-point code.
Two hex digits are exactly one byte, so hexadecimal is how colours (#FF8800 is three bytes), memory dumps and raw byte values get written. Octal survives in Unix file permissions, where 755 reads as three groups of three bits — rwxr-xr-x. Binary is the language of flags and bitmasks, where each bit is one independent on/off setting.
The limit is precision, and it is worth knowing before you trust a very large answer. Conversion runs on JavaScript numbers, which are 64-bit doubles, so results are exact only up to 2⁵³ − 1 = 9,007,199,254,740,991 — thirteen hexadecimal digits or 53 binary digits. Past that, integer arithmetic begins losing the low-order digits and the answer becomes approximate; you would need a big-integer library rather than a browser calculator. Within that range every conversion here is exact, with no rounding at any step. Roman Numeral Converter does the same job for a non-positional system.
Conversions run locally in your browser using integer arithmetic — nothing is uploaded and no account is needed.
Step by step
Type a value and choose the base it is written in.
Read the decimal equivalent as the headline.
See the same number in binary, octal, decimal and hexadecimal in the table.
Why use it
What this tool is good for, and what it deliberately does not try to do.
One entry shows the value in binary, octal, decimal and hexadecimal together, so you never convert in steps.
Hex letters can be upper or lower case and a leading 0x is ignored, matching how bases are written in code.
The input is checked against the selected base — a '2' in binary is rejected rather than silently misread.
Questions
Short, honest answers about quality, limits and privacy.