Number Base Converter
Type a number in any base and see it in binary, octal, decimal and hexadecimal at once, plus any other base from 2 to 36. It shows the bit length and the two's complement form for 8, 16, 32 and 64-bit signed integers. Everything runs in your browser.
8 bits for the size of the number, so 1 byte.
Signed integers (two's complement)- 8-bit: does not fit
- 16-bit: 0x00FF (00000000 11111111)
- 32-bit: 0x000000FF (00000000 00000000 00000000 11111111)
- 64-bit: 0x00000000000000FF (00000000 00000000 00000000 00000000 00000000 00000000 00000000 11111111)
Related Tools
[5 suggestions]Text to Binary Translator
Convert text to binary, hex, decimal, or octal and decode it back, using UTF-8 bytes.
Developer & WebBase64 Encoder / Decoder
Easily encode plain text to Base64 format or decode Base64 back to readable text.
Developer & WebRoman Numeral Converter
Convert numbers to Roman numerals and Roman numerals to numbers, from 1 to 3999.
Student ToolsUnix Timestamp & Epoch Converter
Convert Unix epoch timestamps to UTC and local dates, or convert human dates to Unix timestamps with auto-detection.
Developer & WebChmod Calculator
Work out Unix file permissions: tick boxes, or type octal, an ls -l string or a symbolic change, and get the chmod command.
Developer & WebAbout the Number Base Converter
A base, or radix, is the number of distinct digits a number system uses. Binary has two, octal eight, decimal ten and hexadecimal sixteen, using the letters A to F for the digits ten to fifteen. This converter reads whole numbers with BigInt, so there is no rounding at any size, and a value such as 2 to the power 100 converts exactly. Choose the input base, or leave it on Auto and write a prefix: 0x for hex, 0b for binary and 0o for octal, with plain digits read as decimal. Spaces, underscores and commas inside the number are ignored, so 1111_0000 and 1,234,567 both work, and a leading minus sign is allowed. If you type a digit that does not exist in the base, the tool names it instead of guessing. The signed-integer section shows how the value is stored in 8, 16, 32 and 64 bits using two's complement: a negative number is written as 2 to the power of the width plus the value, so minus 1 is FF in 8 bits and FFFFFFFF in 32 bits. A value that does not fit in a width is marked as not fitting. The tool handles integers only, not fractions, and it stops at 5,000 digits.
How do I convert hexadecimal to decimal?▾
Choose Hexadecimal as the input base, or type a 0x prefix, and the decimal result appears at once. By hand, multiply each digit by 16 raised to its position and add the results.
What is two's complement?▾
It is the way computers store signed integers. A negative number is written as 2 to the power of the bit width plus the value, so minus 1 in 8 bits is 11111111, which is FF in hex.
Why does the converter handle huge numbers exactly?▾
It uses BigInt arithmetic instead of ordinary floating-point numbers, which lose precision above 9,007,199,254,740,991. Every digit is exact up to 5,000 digits.
Does it convert fractions?▾
No. It converts whole numbers only. A value such as 0.5 is not accepted, because fractions do not convert between bases the same way and often repeat forever.