Number Base Converter
Type a number in any box to convert it between binary, octal, decimal, hexadecimal and any base up to 36, with the working shown.
- Binary · Octal · Decimal · Hex
- Step-by-step working
- Two’s complement
- Big numbers
What is a number base converter?
A number base converter rewrites a number in a different positional numeral system. Decimal uses ten digits and powers of 10; binary uses two digits and powers of 2; hexadecimal uses sixteen digits (0–9 and A–F) and powers of 16. This converter keeps every base in sync as you type, handles numbers of any length exactly, supports signed two’s complement values for 8, 16, 32 and 64-bit integers, shows the bits so you can flip them, and explains each conversion step by step.
How to convert decimal to binary
- Type a decimal number in the Decimal box. Prefixes, spaces and underscores are ignored.
- Read the binary result instantly. Binary, octal, decimal, hex and a custom base update together.
- Scroll to “How to convert decimal to binary” for the step-by-step working with your number.
- For negative numbers, tick Signed and choose a bit width to see the two’s complement form. Then copy any result.
Number base cheat sheet
- Binary (base 2) uses 0–1, octal (base 8) uses 0–7, decimal (base 10) uses 0–9 and hexadecimal (base 16) uses 0–9 then A–F for 10–15.
- One hex digit is exactly 4 bits (a nibble), so hex and binary convert digit by digit: F = 1111, A = 1010.
- Common prefixes: 0b for binary, 0o for octal and 0x for hex. They are optional here.
- In two’s complement, the top bit is the sign: 1111 1111 is −1 as a signed 8-bit number but 255 unsigned.
Why use this number base converter
- Converts as you typeNo Convert button: edit either side and the other updates immediately.
- Shows the workingStep-by-step place values or repeated division for the conversion you choose, ideal for homework and exams.
- Any size, signed or unsignedArbitrary-precision integers, plus two’s complement for 8, 16, 32 and 64-bit values.
- Private by designEverything is calculated in your browser. Nothing you type is sent to a server or saved.
Common uses
- Programming. Read flags, masks, colours and memory addresses.
- Computer science courses. Practise conversions with the working shown.
- Networking. Work with IP and MAC address bytes.
- Electronics. Set register values and decode sensor data.
Related converters: hex to decimal, decimal to hex, binary to decimal, decimal to binary, hex to binary, binary to hex, binary calculator, hex calculator. Browse all encoding tools.
Example: decimal to binary
255 (decimal) = 11111111 (binary) = 377 (octal) = FF (hex) −1 as a signed 16-bit value = 1111 1111 1111 1111 = FFFF
What to expect from the result
Whole numbers only: fractional values such as 0.1 are not converted. Very long numbers are converted exactly, but the step-by-step working is shown only for numbers up to 24 digits.
Number Base Converter questions
How do I convert between number bases?
Type the number in the box for its base. All the other bases update instantly. Use the custom base box for anything from base 2 to base 36.
What is two’s complement?
The usual way computers store negative integers. Invert all bits of the positive number and add 1: −5 in 8 bits is 11111011. Tick Signed to see it.
Can it convert very large numbers?
Yes. It uses arbitrary-precision integers, so 100-digit numbers convert exactly without rounding.
What digits does base 36 use?
0–9 and A–Z, where A = 10 and Z = 35. It is used for short IDs and URL shorteners.
Does it convert fractions?
No, whole numbers only. Fractions such as 0.1 often have no exact binary form.