FlipMyFormat

Number Base Converter

A free number base converter for binary, decimal, hex, octal and every base from 2 to 36. Exact maths for numbers of any size, fractions with repeating digits, two's complement, step-by-step working, float bits and text to binary.

Read as Decimal (type 0x, 0b or 0o first, or choose From).

Binary (2)1111 1111
Octal (8)377
Decimal (10)255
Hexadecimal (16)FF
73

Signed numbers (two's complement)

Width
bits

0000 0000 0000 0000 0000 0000 1111 1111hex 000000FF

Step by step

From Decimal to
  1. Divide the whole part by 2 again and again; the remainders read from bottom to top are the digits:
  2. 255 ÷ 2 = 127, remainder 1
  3. 127 ÷ 2 = 63, remainder 1
  4. 63 ÷ 2 = 31, remainder 1
  5. 31 ÷ 2 = 15, remainder 1
  6. 15 ÷ 2 = 7, remainder 1
  7. 7 ÷ 2 = 3, remainder 1
  8. 3 ÷ 2 = 1, remainder 1
  9. 1 ÷ 2 = 0, remainder 1
  10. = 11111111

Bits and their values

1716151413121110

Hover a bit to see its value: bit n is worth 2ⁿ. A set bit is blue.

IEEE 754 floating point

32-bit (float) · hex 437F0000

0 10000110 11111110000000000000000

64-bit (double) · hex 406FE00000000000

0 10000000110 1111111000000000000000000000000000000000000000000000

Sign, exponent, fraction. As a 32-bit float, 255 is stored as 255.

Text to binary and back

01001000 01101001

hex 48 69 · decimal 72 105

Text is turned into UTF-8 bytes, so accents and emoji take 2–4 bytes.

Convert many at once

to

Exact big-number maths in your browser: no size limit and no rounding for whole numbers.

People also use

How to convert a number in three steps

Type a number in the box above and it appears at once in binary, octal, decimal and hexadecimal, plus one more base of your choice from 2 to 36. Leave From on Auto and the tool reads 0x as hex, 0b as binary and 0o as octal; anything else is read as decimal. Each Copy button copies the plain value, without the grouping spaces or commas.

This number base converter does the maths exactly. Whole numbers use big integers, so a 40-digit value converts with no rounding at all. Negative numbers and fractions work too, and the panels below show two's complement, the working, the bits, the IEEE 754 float form and text as bytes. It all runs in your browser.

  1. 1

    Type the number

    Enter it in the Number box. Spaces, underscores and apostrophes are ignored, a leading minus sign is allowed, and one point starts the fraction part.

  2. 2

    Check the input base

    Keep From on Auto (0x, 0b, 0o or decimal), or pick the base yourself, from Binary (2) up to Base 36. The line under the box says how your input was read.

  3. 3

    Copy or dig deeper

    Copy any result, choose another base in the last row, or use the panels below for the working, signed values, floats, text and long lists.

The number base converter remembers Upper-case letters, Group digits, Fraction digits, the bit width and the bases you pick in the panels. The number itself is not saved.

How number bases work

A base, or radix, is how many digits a number system uses. Decimal has ten (0 to 9), binary has two (0 and 1), octal has eight (0 to 7) and hexadecimal has sixteen: 0 to 9, then A to F for ten to fifteen. Higher bases keep going through the alphabet, so base 36 ends at Z.

Each position is worth the base times the position to its right. In binary the positions are worth 1, 2, 4, 8, 16 and so on; in hex they are 1, 16, 256 and 4096. A number base converter only rewrites the same amount with a different set of position values. Some values worth knowing:

DecimalBinaryOctalHex
0000
1111
21022
711177
81000108
10101012A
15111117F
16100002010
321000004020
100110010014464
12711111111777F
1281000000020080
25511111111377FF
256100000000400100
1000111110100017503E8
1024100000000002000400
655351111111111111111177777FFFF

Binary to decimal converter: add up the place values

To read binary, write the place values over the digits from right to left (1, 2, 4, 8, 16, 32 and so on) and add up the ones that sit over a 1. Take 101101: the ones are under 32, 8, 4 and 1, so the value is 45. With 11111111 every place is set: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255.

Type a binary value with 0b in front, or set From to Binary (2), and the Decimal row shows the answer. Used as a binary to decimal converter, the tool has no length limit: a 256-bit pattern comes out as an exact whole number, not a rounded one in scientific notation.

Decimal to binary by repeated division

Going the other way, divide by 2 again and again and write down each remainder. For 156: 156 ÷ 2 = 78 remainder 0, 78 ÷ 2 = 39 remainder 0, 39 ÷ 2 = 19 remainder 1, 19 ÷ 2 = 9 remainder 1, 9 ÷ 2 = 4 remainder 1, 4 ÷ 2 = 2 remainder 0, 2 ÷ 2 = 1 remainder 0 and 1 ÷ 2 = 0 remainder 1. Read the remainders from the bottom up: 10011100.

The Step by step panel prints exactly these lines for any number you type in decimal, so you can check homework or find where a hand calculation went wrong. For decimal to binary with a fraction, it adds a second list that multiplies the fraction part by 2 and keeps each whole part as the next digit.

Hex to decimal and decimal to hex

Hexadecimal packs four bits into one digit, which is why memory addresses, colour codes and byte dumps use it. For hex to decimal, multiply each digit by its place value of 1, 16, 256 or 4096 and add: 2F is 2 × 16 + 15 = 47, and 1A3 is 1 × 256 + 10 × 16 + 3 = 419.

For decimal to hex, divide by 16 and keep the remainders, writing 10 to 15 as A to F. 255 ÷ 16 = 15 remainder 15 (F), then 15 ÷ 16 = 0 remainder 15 (F), so 255 is FF. With From set to Hexadecimal (16), a leading # is accepted, so a web colour such as #1E90FF can be pasted straight in; the Color Picker shows the same colour in other formats.

Binary to hex in groups of four

Because 16 is 2 to the power of 4, every hex digit stands for exactly four bits. To go from binary to hex, split the bits into groups of four from the right, pad the leftmost group with zeros, and swap each group for its digit: 1101 0110 becomes D6, and 101101 becomes 0010 1101, which is 2D.

Group digits does the first half for you: binary is shown in blocks of four bits, hex in blocks of four digits and decimal with commas. Octal works the same way with groups of three bits, since 8 is 2 to the power of 3.

Octal to decimal, and where octal is still used

For octal to decimal, the place values are 1, 8, 64 and 512. The Unix file permission 755 is 7 × 64 + 5 × 8 + 5 = 493, and each octal digit is three permission bits: 7 is 111 (read, write, execute) and 5 is 101 (read and execute).

Octal is rarer than hex today, but it still appears in file permissions and in programming languages that write it as 0o755. Type it with that 0o prefix and Auto reads it as octal.

Binary to decimal with steps: the working panel

The Step by step panel shows how each answer was reached. When the input is not decimal, it first writes each digit times the base to the power of its position. For binary to decimal with steps, type 0b1011 and the panel shows 1 × 2^3 + 0 × 2^2 + 1 × 2^1 + 1 × 2^0, then = 11 in decimal. Digits after the point use negative powers, so binary 0.1 is 1 × 2^-1, which is 0.5.

When the target base is not decimal either, the working carries on from the decimal value: repeated division for the whole part and repeated multiplication for the fraction, with up to 12 fraction steps. By default the target is binary for decimal input and decimal for everything else.

A number base calculator with steps for any base

The same panel works for every pair of bases from 2 to 36, so it doubles as a number base calculator with steps for the less common cases too. Converting 0o755 to base 5, for example, shows the positional sum to 493 first and then the divisions by 5, ending in 3433.

It lists up to 40 positional terms and 70 division lines, which covers anything you would work through by hand. The result rows above are never shortened.

Fractions and repeating digits: why 0.1 never ends in binary

A fraction has a finite number of digits in a base only when every prime factor of its denominator is also a factor of the base. One tenth is fine in decimal, but 10 has a factor of 5 and 2 does not, so 0.1 in binary repeats forever: 0.000110011001100… The tool finds the loop and shows it as 0.0(0011), where the digits in brackets repeat. In hex the same value is 0.1(9), and in octal 0.0(6314).

Because this number base converter uses exact fractions, the repeat is found reliably instead of guessed from rounded digits. When a pattern is longer than the Fraction digits setting (8, 16, 32 or 64), the result stops and ends in “…”. Values such as 0.5, 0.25 and 0.375 end cleanly in binary as 0.1, 0.01 and 0.011.

Two's complement calculator for 8 to 128 bits

Computers store negative whole numbers in two's complement. By hand, write the positive value in the chosen width, flip every bit and add 1. For -42 in 8 bits: 42 is 00101010, flipped it is 11010101, and adding 1 gives 11010110, or D6 in hex.

The Signed numbers panel works as a two's complement calculator: choose a width of 8, 16, 32, 64 or 128 bits and it shows the bit pattern and its hex form, or tells you the number does not fit. As signed values, 8 bits hold -128 to 127 and 16 bits hold -32,768 to 32,767.

It also works backwards. Type a pattern in binary, octal or hex and the panel reads it as a signed value of the chosen width: at 8 bits, 0xFF is -1 (unsigned 255) and 0x80 is -128. In the main rows, a negative number keeps its minus sign, as on paper.

Bits and their values

For whole numbers below 2^64, the Bits and their values panel draws every bit as a cell, numbered from 0 on the right, in rows of 16. Set bits are blue, and hovering a cell shows its worth: bit 7 is 2^7, or 128. The pattern is padded to whole bytes, so 5 appears as 00000101, which makes flags and masks easy to check.

IEEE 754 float bits: how decimals are really stored

Most programming languages keep decimals as IEEE 754 floating point numbers. The IEEE 754 panel shows your number as a 32-bit float (1 sign bit, 8 exponent bits, 23 fraction bits) and a 64-bit double (1, 11 and 52), with the three parts coloured and the hex form of each.

This is where the repeating binary of 0.1 matters. A 32-bit float keeps only 24 significant bits, so 0.1 is stored as 3DCCCCCD, which actually holds 0.10000000149011612. The 64-bit form, 3FB999999999999A, is much closer but still not exact, which is why 0.1 + 0.2 is not exactly 0.3 in many languages.

Text to binary, hex and back

The Text to binary and back panel turns words into UTF-8 bytes and shows each byte in binary, hex and decimal. “Hi” becomes 01001000 01101001, which is 48 69 in hex and 72 105 in decimal. Accented letters and emoji take two to four bytes, so é is C3 A9.

Paste binary such as 01001000 01101001, or hex such as 48 69, into the second box to read it back as text. Binary is read in groups of eight bits and hex in pairs; spaces between bytes are optional.

Convert a list of numbers and save a CSV

Convert many at once turns the number base converter into a batch tool. Paste one number per line; each line is read in the From base (or detected line by line on Auto), converted to the base you pick and listed beside the original. Lines that are not valid numbers are marked “not valid” instead of stopping the list.

Up to 5,000 lines are converted and the first 200 are previewed. The CSV button saves them all as converted-numbers.csv, ready for a spreadsheet.

Number base converter online: any base from 2 to 36, any size

Beyond the four everyday bases, the last row converts to any base from 2 to 36. Base 36 is handy for short IDs: 1,000,000 in decimal is LFLS in base 36. The input can be in any of these bases too, in capitals or small letters.

Many converters use ordinary floating point numbers and quietly round anything above 2^53. This number base converter online uses JavaScript BigInt for whole numbers, so huge values keep every digit. Try 2^128 - 1 in hex, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, and the Decimal row shows all 39 digits of 340282366920938463463374607431768211455.

All settings at a glance

SettingChoicesWhat it does
NumberDigits, a minus sign, one point, 0x / 0b / 0oThe value; spaces, underscores and apostrophes are ignored
FromAuto, or Binary (2) to Base 36How the input is read
Upper-case letters (FF)On or offLetter digits as FF or ff
Group digitsOn or offBinary and hex in blocks of four, decimal with commas
Fraction digits8, 16, 32 or 64Most digits shown after the point
Last result rowBase 2 to Base 36One extra base of your choice
Width8, 16, 32, 64 or 128 bitsFor two's complement and signed reading
Step by step, toBase 2 to Base 36Target base for the working
Convert many at once, toBase 2 to Base 36Target base for the list and CSV

What people convert numbers for

Programming and debugging

Read hex values from logs and memory dumps, check bit masks and flags, and see a negative integer in 32 or 64 bits.

Computer science homework

Check conversions done by hand against the working, including fractions and two's complement questions.

Networking and electronics

Turn subnet mask parts into binary (255 is 11111111), set register bits and read 8-bit or 16-bit sensor values as signed numbers.

Data and encodings

Look at text as UTF-8 bytes, compare it with the Base64 tool or URL Encode, and convert whole lists for a spreadsheet.

Troubleshooting: errors and odd results

“G” is not a base-16 digit

The input has a digit the base does not allow, such as 2 in binary or G in hex. On Auto, a number without a prefix is read as decimal, so FF needs 0x in front.

A binary number gave a huge decimal

On Auto, 1010 without a prefix is one thousand and ten. Add 0b or choose Binary (2) under From; the line under the box says how the input was read.

Only one point is allowed

A number such as 1.234.567 has more than one point. Spaces, underscores and apostrophes work as separators, but points and commas do not.

Text comes out garbled

Bytes must be complete: binary in groups of eight bits, hex in pairs. A hex string made only of 0s, 1s and spaces is read as binary.

Is it private? Everything stays in your browser

This number base converter runs entirely in your browser with JavaScript. Nothing you type is uploaded or logged. Only your display settings are saved, in this browser's local storage, and clearing your site data removes them.

What to do next

Working with other encodings? Try the Base64 tool, URL Encode for links, the Hash Generator for MD5 and SHA-256 fingerprints, and the Timestamp Converter for Unix times.

Frequently asked questions

How do I use this number base converter?

Type a number in the Number box and the binary, octal, decimal and hex results appear straight away. Leave From on Auto, or pick the input base yourself. Press Copy beside any row to take that value.

Is the number base converter online free, and does it upload my numbers?

Yes, it is free with no sign-up, and nothing is uploaded. All conversion happens in your browser, so it is fine for private values.

How does the binary to decimal converter read 11111111?

Each 1 adds its place value: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Type it as 0b11111111, or choose Binary (2) under From, and the Decimal row shows 255.

How do I convert decimal to binary by hand?

Divide by 2 again and again, writing down each remainder, until the quotient is 0. Then read the remainders from last to first. The Step by step panel prints every division for your number.

How do I go from hex to decimal?

Multiply each hex digit by 16 to the power of its position, counting from 0 on the right, and add. 1A3 is 1 × 256 + 10 × 16 + 3 = 419. In the tool, type 0x1A3 and read the Decimal row.

How do I convert decimal to hex?

Divide by 16 again and again, keep the remainders, write 10 to 15 as A to F, and read them from the bottom up. 255 gives 15 and 15, so it is FF. Choose Hexadecimal (16) in the Step by step panel to see the working.

What is the fastest way to turn binary to hex?

Split the bits into groups of four from the right, pad the left group with zeros, and replace each group with one hex digit, so 1101 0110 is D6. The tool does it instantly, and Group digits shows the blocks of four.

How does octal to decimal work?

Each octal digit is multiplied by a power of 8: 1, 8, 64, 512 and so on. So 755 is 7 × 64 + 5 × 8 + 5 = 493. Type 0o755, or set From to Octal (8), to check it.

Can I see binary to decimal with steps?

Yes. Enter a binary number and the Step by step panel lists each digit times 2 to the power of its position, then the total. For 0b1011 that is 1 × 2^3 + 0 × 2^2 + 1 × 2^1 + 1 × 2^0 = 11.

Is there a number base calculator with steps for other bases?

Yes. The Step by step panel accepts any target from base 2 to base 36, and the input can be in any of those bases too. It shows the positional sum to decimal first, then the divisions into the target base.

How does the two's complement calculator handle negative numbers?

Type a negative whole number, such as -42, and choose a width from 8 to 128 bits. The panel shows the bit pattern, 11010110 at 8 bits, and its hex form D6. If the number is too large for the width, it says so.

How do I read a hex or binary pattern as a signed number?

Type the pattern in binary, octal or hex and pick the width. The Signed numbers panel shows the signed value next to the unsigned one, so 0xFF at 8 bits reads as -1 (unsigned 255).

Does the number base converter work with negative numbers?

Yes. In the binary, octal, decimal and hex rows a negative number keeps its minus sign, so -10 is -1010 in binary. For the bit pattern a computer would store, use the Signed numbers panel with the width you need.

Why does 0.1 show as 0.0(0011) in binary?

One tenth has no exact binary form, so its digits repeat forever. The part in brackets, 0011, is the block that repeats. The tool works with exact fractions, so it finds the loop rather than printing rounded digits.

What does “…” at the end of a result mean?

The fraction goes on beyond the Fraction digits setting and no repeat was found within that limit. Raise the setting to 64 to see more digits.

How big a number can the number base converter handle?

Whole numbers use exact big integer maths, so there is no practical size limit and no rounding. The bits table appears for whole numbers below 2^64, and the float panel for values a 64-bit double can hold.

Which bases are supported?

Every base from 2 to 36, with the letters A to Z as digits above 9. Binary, octal, decimal and hexadecimal are always shown, and the last row shows one extra base of your choice.

What does Auto mean in the From box?

Auto looks at the start of the number: 0x means hexadecimal, 0b binary and 0o octal. Anything without a prefix is read as decimal, so add 0x before hex digits such as FF.

What is the IEEE 754 panel for?

It shows how the number is stored as a 32-bit float and a 64-bit double, with sign, exponent and fraction bits in different colours and the hex form of each. It explains why values such as 0.1 are slightly off inside programs.

Can I convert text to binary?

Yes. Type text in the Text to binary and back panel to get its UTF-8 bytes in binary, hex and decimal. Paste binary or hex into the second box to turn it back into text.

Can I convert a whole list at once?

Paste one number per line into Convert many at once, pick the target base, and press the CSV button to download the results. Up to 5,000 lines are converted, and invalid lines are marked instead of breaking the list.

Convert a number now

Binary, octal, decimal, hex and any base up to 36. Exact, free and computed on your device.

Back to the tool

Last updated October 2026 · Written and maintained by the FlipMyFormat team