Number base converter
Convert whole numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, including negative numbers.
Digits 0 to 9, optional leading minus sign.
Digits 0 and 1 only.
Digits 0 to 7 only.
Digits 0 to 9 and letters A to F.
How it works
A number base converter transforms integers between positional numeral systems, such as binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16), which use different digit sets to represent the same value.
- Type a number in any field
The other bases update automatically as you type.
- Use a preset or a custom base
Jump to a common value, or convert to any base from 2 to 36.
- Read every representation
Binary, octal, decimal and hex all stay in sync.
Converting between bases
To convert decimal to binary, repeatedly divide by 2 and record the remainders from bottom to top. For 13: 13 divided by 2 is 6 remainder 1; 6 divided by 2 is 3 remainder 0; 3 divided by 2 is 1 remainder 1; 1 divided by 2 is 0 remainder 1. Reading the remainders bottom to top gives binary 1101.
Where each base is used
- Binary (base 2): the native language of digital circuits, which have two states, on and off.
- Octal (base 8): each digit maps to exactly 3 binary bits; still seen in Unix file permission modes such as chmod 755.
- Hexadecimal (base 16): each digit maps to exactly 4 binary bits, so it is compact. Hex appears in memory addresses, color codes like #FF5733, and machine code.
Negative numbers and fractions
Negative integers are supported and shown with a leading minus sign in every base, for example decimal -128 is binary -10000000. This is sign-magnitude notation, not the two's complement form some processors use internally. Fractional values are not supported; enter whole numbers only.
Frequently asked questions
How do you convert a decimal number to binary?
Repeatedly divide by 2 and record the remainders from bottom to top. For 13: 13 divided by 2 is 6 remainder 1, 6 divided by 2 is 3 remainder 0, 3 divided by 2 is 1 remainder 1, 1 divided by 2 is 0 remainder 1, giving binary 1101. The converter does this instantly: type 13 in the decimal field and binary 1101 appears automatically.
What is hexadecimal and where is it used?
Hexadecimal (base 16) uses digits 0 to 9 and letters A to F, where A equals 10 and F equals 15. It is widely used in computing because each hex digit maps exactly to 4 binary bits, making it compact. Hex appears in memory addresses, color codes such as #FF5733, and machine code representations.
How does octal (base 8) differ from binary and hexadecimal?
Octal uses digits 0 to 7 and each octal digit maps to exactly 3 binary bits. For decimal 255: binary is 11111111, octal is 377, hex is FF. Octal was common in early computing and is still seen in Unix file permission modes, for example chmod 755.
Can this converter handle negative numbers or fractions?
Negative whole numbers are supported: enter a leading minus sign in any field and every other base shows the same negative value in sign-magnitude form, for example decimal -128 converts to binary -10000000. Fractional values and two's complement encoding are outside the scope of this tool; enter whole numbers only.
Why do computers use binary instead of decimal?
Electronic circuits are most reliably built with two states, on and off, representing 1 and 0. This makes binary the natural language of digital hardware. Hexadecimal is a human-friendly shorthand since each hex digit represents exactly 4 bits, reducing the number of characters needed to express binary values.