TTKTheTextKit
Developer & Web Tools

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.

Binary1111 1111
Octal377
Decimal255
HexFF
Base73

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]

About 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.