Skip to main content
ZEKILO Dev

Number Base Converter

Type a number and see it in binary, octal, decimal, hex, and a base of your choice at once.

Stays in your browserECMAScriptAs of 2026.10.03

Input

Press Esc, then Tab to leave the editor.

Output

Value in each base
Binary (base 2)—
Octal (base 8)—
Decimal (base 10)—
Hexadecimal (base 16)—
Base 36—

How to use Number Base Converter

  1. 1Type a number into the input panel, or press Sample.
  2. 2Choose the input base. The prefixes 0b, 0o, and 0x are detected automatically.
  3. 3Press the Copy button at the end of the row you need.

Number Base Converter options

Input base
2, 8, 10 (default), 16, or Custom. If the number starts with 0b, 0o, or 0x, that prefix decides the base instead.
Custom base
A base from 2 to 36 (default 36). It is the input base when Custom is selected, and it is always shown as the last row of the result.
Negative numbers
Minus sign (default) writes negative values with a leading minus. 2's complement (8, 16, 32, or 64 bits) shows the binary, octal, and hex rows as a fixed-width bit pattern, while the decimal and custom-base rows keep the minus sign.
Group binary and hex digits by 4
On (default): binary and hex digits are shown in groups of four separated by spaces. The other rows are not grouped.
Keep the spaces when copying
Off (default): the copy button copies the digits without the grouping spaces. Turn it on to copy them exactly as shown.

Exact integers with BigInt

A JavaScript Number is a 64-bit float and represents integers exactly only up to 2^53. A converter built on parseInt and Number.prototype.toString silently changes the last digits of anything larger, such as a 64-bit ID or a hash. This tool does all arithmetic with BigInt, the arbitrary-precision integer type of ECMAScript, so every digit of the result is exact. The input is limited to 1,000 digits.

Bases above 10 use the letters a to z for the digit values 10 to 35, which is why the highest base is 36.

Two’s complement

In two’s complement with N bits, a negative value v is stored as the bit pattern of 2^N + v. With 8 bits, -1 is 256 - 1 = 255, written 11111111, and the range is -128 to 127. The binary, octal, and hex rows show that bit pattern padded to the full width. The decimal row and the custom-base row show the value itself with a minus sign.

Number Base Converter examples

  • Decimal to binary, octal, and hex

    With digit grouping on, the binary row is shown as 1111 1111. Copying still gives 11111111.

    Input

    255

    Output

    Binary: 11111111
    Octal: 377
    Hexadecimal: ff
  • Hex with the 0x prefix

    The prefix decides the base, whatever input base is selected.

    Input

    0x7fffffff

    Output

    Decimal: 2147483647
  • A number larger than 64 bits can hold

    This is 2^64. No digit is rounded.

    Input

    18446744073709551616

    Output

    Hexadecimal: 10000000000000000
  • A negative number in 8-bit two's complement

    Negative numbers: 2's complement 8-bit.

    Input

    -1

    Output

    Binary: 11111111
  • The lowest 8-bit value

    Negative numbers: 2's complement 8-bit. -129 is reported as out of the 8-bit range (-128 to 127).

    Input

    -128

    Output

    Binary: 10000000
  • A digit that does not fit the base

    Input base: 16.

    Input

    12g

    Output

    'g' (character 3) is not a digit in base 16.

Examples use the reference cases this tool is tested against.

Number Base Converter: frequently asked questions

Is my input sent to a server?

No. Your input and the result are processed only in this browser and are not stored. Reloading the page clears them.

Are very large numbers converted exactly?

Yes. The tool calculates with BigInt integers instead of floating-point numbers, so 18446744073709551616 (2^64) becomes hex 10000000000000000 with no rounding. The input can be up to 1,000 digits long.

Can it convert fractions such as 0.5?

No. Only integers are supported. A decimal point is reported as an error.

How does two's complement work here?

Choose 8, 16, 32, or 64 bits. In 8 bits, -1 is 11111111 and -128 is 10000000. The value has to fit the signed range of that width, so in 8 bits anything below -128 or above 127 is reported as out of range.

Which characters can I type?

The digits and letters that are valid in the chosen base (upper or lower case), an optional leading + or -, and an optional 0b, 0o, or 0x prefix. Spaces and underscores between digits are ignored, so 1111 1111 and 0xFFFF_FFFF both work.

What happens when a digit does not fit the base?

The error names the character and its position. For 12g in base 16 it says that 'g', character 3, is not a digit in base 16.

How it works · Standards

  • Processed in: this browser (your device). Nothing is sent or stored.
  • Standards: ECMAScript
  • Engine: ZEKILO Dev base converter (BigInt) (in-house code)
  • A prefix letter that is itself a digit in the selected base is read as a digit: with input base 16, 0b1 is the hex number b1, not binary 1.
  • Output letters are lowercase. Empty input is not an error.
  • As of 2026.10.03
  • Changelog: 2026.10.03 First release
Open-source licenses →
Something wrong with the result? Report an issue(Your input is not attached)