Number Base
Convert numbers between binary, octal, decimal and hexadecimal
About Number Base
Type a value in binary, octal, decimal or hexadecimal and the other three representations appear instantly, each with a copy button; binary, octal and hex results carry 0b, 0o and 0x prefixes. Hex digits are accepted in either case and shown in uppercase. Handy for reading bit masks, byte values, memory offsets, color channels or Unix permission modes.
Category: Text.
Frequently asked questions
What number bases are supported?
▾
Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Pick the input base with the buttons above the field; switching bases clears the input, and a leading 0b, 0o or 0x in what you type is ignored.
Where is hexadecimal used in programming?
▾
Memory addresses, color codes (#FF5733), bit flags, byte-level data inspection, Unicode code points (U+1F600), and network protocols. Hex is compact — each digit represents exactly 4 bits.
What is the maximum number that can be converted?
▾
Results are exact up to 2^53 - 1 (9,007,199,254,740,991), JavaScript's safe integer limit. Larger values are still converted but lose precision, because the tool uses regular JavaScript numbers rather than BigInt.
Can I convert negative numbers or fractions?
▾
Negative whole numbers work and are shown with the minus sign after the prefix (for example 0b-1010), not in two's complement. Fractions are not supported: reading stops at the first character that is not a valid digit for the chosen base, so 10.5 is converted as 10.