UtilDojo

Popular

Menu

Number Base Converter — Binary, Decimal, Hex, Octal

  • This tool runs entirely in your browser. Nothing you enter or upload is sent to a server.

Number

Binary (base 2)

11111111

Octal (base 8)

377

Decimal (base 10)

255

Hexadecimal (base 16)

ff

Works with very large numbers exactly. You can paste numbers with 0b, 0o or 0x prefixes, spaces or underscores, and a leading minus sign.

About this tool

Type a number, pick the base it is written in and see it in binary, octal, decimal and hexadecimal at once. Each result has its own Copy button. The tool opens with 255 in decimal, which shows as 11111111, 377 and ff.

It uses exact big-number arithmetic, so values far beyond what a calculator or JavaScript number can hold, such as a 64-bit or 128-bit integer, convert without rounding. The decimal sample, 18446744073709551615 (the largest 64-bit unsigned value), becomes ffffffffffffffff in hex. Other samples include DEADBEEF in hex, 755 in octal (the common Unix file permission, 493 in decimal) and 1111 0000 1010 0101 in binary (61,605).

You can paste numbers with 0b, 0o or 0x prefixes, spaces or underscores between digits, and a leading minus sign. Turn on grouping to read long binary and hex values in fours, and uppercase to show hex as FF instead of ff.

If a digit does not belong to the chosen base, the message names it, for example “2” is not a valid digit in base 2. Fractions are not supported: 1.5 is rejected because the dot is not a digit, so convert the whole and fractional parts separately.

Negative numbers show the sign in front of the digits, for example -10 as -1010, rather than a two’s-complement bit pattern. If you need the fixed-width form used in memory, pad and invert the bits yourself. For text rather than numbers, use the Text to Binary Converter. All the work is done in your browser.

Frequently asked questions

How do I convert binary to decimal?

Choose Binary, type the number (for example 1010) and read the Decimal result (10). Each binary digit is a power of two, added up from the right.

Why is hex used in programming?

One hex digit stands for exactly four bits, so a byte is two hex digits. It is a compact way to write memory addresses, colors and binary data.

Does it handle negative numbers?

Yes, a leading minus sign is kept. It shows the signed value, not a two’s-complement bit pattern.

Is there a size limit?

No fixed limit. Extremely long numbers only depend on your device’s memory, and nothing is uploaded.

What is 0o755 or 0x1F?

The prefixes show the base: 0o for octal, 0x for hex and 0b for binary. 0x1F is 31 and 0o755 is 493 in decimal. The tool accepts them when the matching base is selected.

Related tools