Skip to content
brownie.tools

Number Base Converter

Convert exact integers across bases 2–36 and inspect fixed-width bits without silent truncation.

Input base

Optional + or - sign; matching 0b, 0o or 0x prefix; spaces or underscores between digits. Integers only. Up to 4,096 input characters.

2Binary

—

8Octal

—

10Decimal

—

16Hexadecimal

—

36Base 36

—

Negative numbers and boundary examples

Choose an example to set decimal input and word width. Signed maximum + 1 is a valid unsigned bit pattern, interpreted as signed minimum. Values outside the full input range overflow; no bits are truncated.

8-bit words

16-bit words

32-bit words

64-bit words

Positive input is an unsigned bit pattern; negative input is encoded using two’s complement. The conversions above keep the mathematical value.

Runs locally in your browser. Nothing is uploaded or sent to a server.

Choose Input base and enter an integer to see binary, octal, decimal and hexadecimal results together. Select any additional output base from 2 to 36, then copy individual results or all labelled conversions. The converter uses exact BigInt arithmetic on your device, accepts signs and grouped digits, and limits input to 4,096 characters. Show steps explains repeated division for magnitudes up to 2^64. The optional fixed-width view provides padded bits and signed or unsigned interpretations with overflow checks.

Updated

How Do You Convert an Integer Between Number Bases?

Choose DEC under Input base and enter 180 in Decimal integer. The results are binary 1011 0100, octal 264, decimal 180 and hexadecimal B4. Set Additional output base (2–36) to Base 36 to get 50. All five outputs describe the same integer; the letters and digit positions change with the radix.

The same integer written in five bases
BaseUngrouped resultPositional check
2 (binary)10110100128 + 32 + 16 + 4 = 180
8 (octal)2642 × 64 + 6 × 8 + 4 = 180
10 (decimal)1801 × 100 + 8 × 10 = 180
16 (hexadecimal)B411 × 16 + 4 = 180
36505 × 36 = 180

Select the radix of the number you have, then enter its digits. The four standard outputs show binary, octal, decimal and hexadecimal at the same time. The additional output selector handles less common systems such as base 3, base 12 or base 36 without replacing the standard results. This makes it useful when checking an identifier, documenting an encoding or comparing a custom numeral system with a register value.

A base defines the number of digit symbols available. Binary uses 0 and 1; octal uses 0–7; decimal uses 0–9; hexadecimal adds A–F. Higher bases continue through the alphabet, ending with Z as digit 35 in base 36. Letters are case-insensitive on input. Decimal 35 is therefore Z in base 36, 23 in hexadecimal and 1022 in base 3. These are representations of the same integer, not different values or text encodings.

Which Input Formats Are Accepted?

An integer may start with an ASCII plus or minus sign. Select hexadecimal to paste -0xFF, binary to paste 0b1011 0100, or octal to paste 0o755. Prefixes are optional and must match the selected common base. They do not automatically change the input selector. In a higher base where the letters are valid digits, the same characters are ordinary digits instead: 0xFF in base 36 is interpreted as base-36 digits, not as a hexadecimal prefix.

Spaces and single underscores between digit groups improve readability without changing the value. For instance, decimal 1_000 is one thousand, and hexadecimal DE AD BE EF is the integer 3,735,928,559. An underscore cannot begin or end a value, and repeated underscores are rejected. A sign or prefix cannot be separated from its digits. Decimal points, comma grouping and scientific notation in decimal are rejected rather than partially parsed or rounded.

How Do Signed Integers Differ from Fixed-width Bit Patterns?

The main results always express a mathematical integer. Decimal -1 becomes binary -1 and hexadecimal -1, because no word width is implied. This is different from a machine register, where a finite set of bits can represent either a signed or an unsigned value.

The optional fixed-width panel provides that second view. Choose 8, 16, 32, 64, 128 or 256 bits. A positive value is an unsigned bit pattern, while a negative value is encoded using two’s complement. At 8 bits, decimal 255 and decimal -1 both yield binary 11111111 and hex FF. The signed interpretation is -1 and the unsigned interpretation is 255. At 16 bits, positive 255 instead yields 0000000011111111, hex 00FF, and signed decimal 255.

For a width of n bits, the accepted input range is −2^(n−1) through 2^n−1. This includes signed negative inputs and every unsigned bit pattern. The panel rejects values outside that range instead of wrapping them or cutting off high bits. Binary output is padded to exactly n bits; hexadecimal output has n/4 digits. The main conversions keep their mathematical meaning when you enable or change the fixed width.

How Does Binary-to-Decimal Conversion Work?

Each position has a weight equal to a power of its base. In binary, positions from right to left have weights 1, 2, 4, 8 and so on. Binary 1011 0100 is 128 + 32 + 16 + 4 = 180 in decimal. Its hexadecimal representation is B4: B represents 11, so 11 × 16 + 4 = 180.

One hexadecimal digit corresponds to exactly four binary bits, also called a nibble. An octal digit corresponds to three bits. This relationship explains why hexadecimal is convenient for memory addresses and byte values, while octal is useful for Unix permission groups. Permission 755 consists of octal digits 7, 5 and 5, corresponding to binary groups 111, 101 and 101. The converter treats that input as one octal integer when base 8 is selected.

What Are the Precision and Size Limits?

The converter parses digits with BigInt arithmetic and formats the result in the requested radix. It does not pass the integer through floating-point arithmetic. A value such as 9,007,199,254,740,993, which exceeds the standard JavaScript safe-integer boundary, therefore retains every digit during conversion. Large unsigned 64-bit values work in the main outputs and in the 64-bit word view without losing low-order bits.

Input is limited to 4,096 characters, counting surrounding whitespace, signs, prefixes and separators. Oversized input shows an error and no conversion is produced. Switching the input base normally carries the current value into the new radix. If that representation would exceed the same limit, the existing input and base are kept and an explanation appears. This avoids silently shortening a large value. Copying an output returns ungrouped digits; fixed-width copies also retain their zero padding.

How Can You Check the Conversion Steps?

Show steps follows the Additional output base (2–36) selector, not the input base. For decimal 180 with Base 16 selected, it shows 180 ÷ 16 = 11, remainder 4, then 11 ÷ 16 = 0, remainder B. Reading upward gives B4. For a negative input, the divisions use its absolute value and the final representation retains the minus sign.

The step list is available through magnitude 2^64, including that endpoint. Above it, the panel explains the limit while the main conversions still work within the input character budget. Zero produces one division with quotient zero and remainder zero. This is a calculation trace for one integer, rather than a batch converter or a floating-point representation viewer.

What Exactly Do the Copy Buttons Preserve?

Individual result buttons copy ungrouped digits without prefixes. Copy all creates one line per common base, labelled BIN, OCT, DEC and HEX. It adds a BASE label with the radix number when the additional base is distinct, avoiding a duplicate line for a common base. Mathematical results omit leading zeroes; fixed-width copies retain their padding.

Open Negative numbers and boundary examples to load decimal inputs and widths for 8, 16, 32 or 64 bits. Each group covers signed and unsigned limits plus values just outside the accepted range. Use these to distinguish a valid unsigned pattern from overflow before copying it into code. For text encoding, use Base64 Encode Decode; for interpreting epoch values, use Unix Timestamp Converter. Neither task is performed by changing an integer’s radix.

How to Use Number Base Converter

  1. Input base

    Choose BIN, OCT, DEC or HEX, or use Any input base (2–36). Select the source base before entering digits; changing it afterward converts an already valid value.

  2. Decimal integer

    With DEC selected, enter a whole number in Decimal integer. This label changes with the source base, for example to Hexadecimal integer. An optional sign, matching prefix and spaces or single underscores between digit groups are accepted.

  3. Additional output base (2–36)

    Choose another radix while keeping Binary, Octal, Decimal and Hexadecimal visible. Copy an individual result, or use Copy all for labelled conversions including a distinct additional base.

  4. Show steps

    Expand Show steps to inspect division by the additional output base. Read the remainders from bottom to top, keeping the original sign. Steps are available for absolute values up to 2^64.

  5. Fixed-width / two’s complement

    Choose 8, 16, 32, 64, 128 or 256 bits. Read Binary bits, Hex bytes, Signed decimal and Unsigned decimal. An out-of-range value produces an error instead of truncation.

Frequently Asked Questions