Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal instantly. Supports negative numbers, two's complement (8/16/32-bit), and any custom base from 2 to 36. Free, works entirely in your browser.

Did we solve your problem today?

What Is a Number Base Converter?

A Number Base Converter translates integer values between different positional numeral systems — binary, octal, decimal, and hexadecimal — instantly in your browser. No server, no upload, no data leaving your device.

Supported Number Systems

BaseNameDigitsExample
2Binary0, 11010
8Octal0–712
10Decimal0–910
16Hexadecimal0–9, A–F0xA
2–36Custom0–9, a–zz (base 36)

How to Use

  1. Type a number into any of the four base fields
  2. All other bases update instantly
  3. For negative numbers, prefix with a minus sign (e.g. -128, -ff)
  4. Select a bit width (8, 16, or 32) to see the two’s complement representation
  5. Use the Custom Base field to convert to any base from 2 to 36

Formatted Output

Each result field shows the raw digits. The tool uses standard programming prefixes in the two’s complement section:

Negative Numbers and Two’s Complement

When you enter a negative number and select a bit width, the tool shows the two’s complement representation — the method used by virtually all modern processors to store negative integers.

How Two’s Complement Works

For an N-bit system, the two’s complement of a negative number −x is calculated as 2^N − x. For example:

The three available bit widths cover the most common integer sizes:

Bit WidthRange (signed)Max unsigned
8-bit−128 to 127255
16-bit−32,768 to 32,76765,535
32-bit−2,147,483,648 to 2,147,483,6474,294,967,295

Binary (Base 2)

Binary is the foundation of all digital computing. Each digit (bit) is either 0 or 1, representing the off and on states of transistors. Groups of 8 bits form a byte; 16, 32, and 64-bit groupings are the basis of modern integer types.

Converting decimal to binary: repeatedly divide by 2 and collect remainders from last to first. For example, 10 ÷ 2 = 5 R0, 5 ÷ 2 = 2 R1, 2 ÷ 2 = 1 R0, 1 ÷ 2 = 0 R1 → read remainders bottom-to-top: 1010.

Octal (Base 8)

Octal was historically used in early computing because 3 binary digits map exactly to one octal digit. It is still used in Unix file permissions (e.g. chmod 755) and some low-level programming contexts.

Hexadecimal (Base 16)

Hexadecimal is the most practical shorthand for binary data because 4 bits map exactly to one hex digit. One byte is always exactly two hex characters (00–FF). Hex appears everywhere in computing: HTML colors (#ff6b6b), memory addresses, cryptographic hashes, and assembly language.

Custom Base (Base-N)

Any positional system from base 2 to base 36 is supported. Digits above 9 use letters a–z. Base 36, for example, is used in URL shorteners and compact ID encoding since it uses all alphanumeric characters.

Privacy

All conversions are computed locally in your browser using JavaScript’s built-in integer operations. No number is ever sent to a server, stored, or logged.

FAQ

What bases does this converter support?

The converter supports binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) as primary inputs and outputs. It also includes a custom base field that accepts any base from 2 to 36, covering all alphanumeric number systems.

How do I convert a negative number?

Simply prefix your number with a minus sign (e.g. -42, -ff, -1010). The tool will show the signed representation in all bases. If you select a bit width (8, 16, or 32 bits), it also shows the two's complement representation used in computing.

What is two's complement?

Two's complement is the standard way computers represent negative integers in binary. For an N-bit system, a negative number -x is stored as 2^N − x. For example, −1 in 8-bit two's complement is 11111111 (255 decimal). The converter shows two's complement automatically when you enter a negative number and select a bit width.

Is my data sent to a server?

No. All conversions are computed locally in your browser using pure JavaScript integer operations. No data is ever sent to a server, stored, or logged.