nicetool.dev logo

Number Base Converter

Type in any field and the others update. Prefixes 0b, 0o, 0x and digit separators are accepted.

8 bits1 byteFits in 8-bit

Two's complement

8-bit1111 11110xFF
16-bit0000 0000 1111 11110x00FF
32-bit0000 0000 0000 0000 0000 0000 1111 11110x000000FF
64-bit0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 11110x00000000000000FF

Shows how the value is stored in a fixed-width integer. Negative numbers use two's complement; values above the signed maximum are shown as unsigned.

What is a number base?

A number base (radix) is how many digits a positional system uses. We count in base 10, computers store data in base 2, and programmers read memory addresses, colors and byte values in base 16 because one hex digit maps to exactly four bits. This converter uses arbitrary-precision integers, so 64-bit and even larger values convert exactly without rounding.

Features

  • • Binary, octal, decimal and hex side by side, plus any base from 2 to 36
  • • Arbitrary-size integers with BigInt, negative numbers included
  • • Accepts 0b, 0o, 0x prefixes and spaces or underscores between digits
  • • Bit and byte length, digit grouping and uppercase hex
  • • Two's complement view for 8, 16, 32 and 64-bit integers

Fast and private

Every conversion runs in your browser as you type. No numbers are sent to a server.

Exact BigInt math, 100% client-side.

How to use the Number Base Converter

  1. 1

    Type a number into any field: binary, octal, decimal, hexadecimal or the custom base. Prefixes like 0x, 0b and 0o and separators like 1_000 or spaces are accepted.

  2. 2

    All other fields update instantly. Pick any base from 2 to 36 in the custom field, for example base 36 for short IDs.

  3. 3

    Turn on digit grouping to read long values (binary in groups of 4, hex in bytes) and choose uppercase or lowercase hex.

  4. 4

    Check the bit length and the two's complement table to see how the value is stored in 8, 16, 32 and 64-bit integers, then copy the format you need.

Practical examples

Reading hex dumps and colors

0xFF is 255, so the CSS color #FF8000 means red 255, green 128 and blue 0. Converting each byte helps when debugging colors or binary file formats.

Unix file permissions

chmod 755 is octal. Converted to binary it becomes 111 101 101: read, write and execute for the owner, read and execute for group and others.

Bit flags and masks

Feature flags stored as integers are easier to understand in binary. The value 13 is 1101, meaning flags 0, 2 and 3 are set.

Negative numbers in low-level code

An error code like 0xFFFFFFFF from a C API is -1 as a signed 32-bit integer. The two's complement view shows both interpretations.

Frequently asked questions

Why do programmers use hexadecimal?+

One hex digit represents exactly four bits, so two digits make one byte. Memory addresses, colors, hashes and byte values are much shorter and easier to read in hex than in binary.

What is two's complement?+

The standard way computers store signed integers. The highest bit carries a negative weight, so in 8 bits the pattern 11111111 means -1 and 10000000 means -128.

Is there a size limit?+

No practical limit. The converter uses BigInt, so numbers far beyond 64 bits convert exactly, unlike calculators that switch to floating point and lose digits.

What digits do bases above 10 use?+

After 0-9 come the letters A-Z, so base 16 uses 0-9 and A-F, and base 36 uses all digits and all 26 letters. Letters are not case-sensitive in input.