Tarayıcınız güncel değil

Bu siteyi görüntülemek için tarayıcınızın veya cihazınızın işletim sisteminin güncellenmesi gerekiyor.

Your browser is out of date. Please update iOS or your browser to view this site.

Skip to main content
Gizke.com
Blog

Number Base Converter

Runs on your device. Nothing is sent.
Start with 0x, 0b or 0o to type hex, binary or octal. Spaces and _ between digits are ignored.
Examples

Results

Binary (2)
11111111
Octal (8)
377
Decimal (10)
255
Hexadecimal (16)
FF
73
Bits needed
8
Bits set to 1
8
Unicode character
U+00FF ÿ

Two's complement

How this number is stored in a fixed number of bits, read as signed and unsigned. Tap a bit to flip it.

Signed
-1
Unsigned
255
Hex
0xFF
Binary
1111 1111
Bytes, big-endian
FF
Bytes, little-endian
FF
Bitwise NOT
0x00

Bits

The leftmost bit is the sign bit: when it is 1, the signed value is negative.
How it's worked out
From decimal to:
DivisionQuotientRemainder
255 ÷ 21271
127 ÷ 2631
63 ÷ 2311
31 ÷ 2151
15 ÷ 271
7 ÷ 231
3 ÷ 211
1 ÷ 201

Remainders from bottom to top: 11111111

Convert numbers between binary, octal, decimal, hex and any base from 2 to 36 - exact for huge numbers, fractions and two's complement.

A converter for programmers, students and anyone reading a hex dump: type a number in binary, octal, decimal, hexadecimal or any base from 2 to 36 and see it in all of them at once. It is exact - a 40-digit number keeps every digit, and a fraction like 0.1 shows the digits that repeat forever instead of a rounded guess. Whole numbers also get their two's complement at 8 to 128 bits, with byte order and a bit grid you can click, and the steps behind each conversion for homework.

Frequently asked questions

How do I convert binary to decimal?
Multiply each digit by its place value and add them up. Place values in binary are powers of 2 counted from the right: 1, 2, 4, 8, 16 and so on. So 1011 is 1×8 + 0×4 + 1×2 + 1×1 = 11. Open "How it's worked out" to see this for your own number.
How do I convert decimal to binary or hex?
Divide by the new base again and again and write down each remainder until the quotient is 0. Read the remainders from bottom to top: 11 ÷ 2 gives remainders 1, 1, 0, 1, so 11 is 1011 in binary. In hex the remainders 10 to 15 are written A to F.
Why is FF equal to -1?
In 8 bits, FF (11111111) is 255 as an unsigned number but -1 in two's complement, the way computers store signed integers: the leftmost bit counts as -128 instead of +128. The same pattern in 16 bits (00FF) is just 255. Choose the bit width to see a pattern read both ways.
Why does 0.1 never end in binary?
0.1 is 1/10, and 10 has the factor 5, which binary cannot divide evenly - just as 1/3 never ends in decimal. The digits 0011 repeat forever: 0.0(0011). Most calculators round this; here the repeating digits are found exactly and drawn under a line. It's also why 0.1 + 0.2 isn't exactly 0.3 in most programming languages.
How big can the numbers be?
Up to 4,096 characters, with every digit kept. Many converters use JavaScript's ordinary numbers and silently round anything above 9,007,199,254,740,991 (2^53 − 1); this one uses exact big-integer arithmetic, so 64-bit and 128-bit values come out right.
Is my number sent anywhere?
No. Everything is calculated in your browser, so the page works offline too. A copied link keeps the number in the address after ?q= - share it only with people who may see it.

Share this tool

BlogAboutContactTerms of UsePrivacy Policy