Skip to main content
Calnex LogoCalnex
Developer Tools

Number Base Converter

Convert signed integers exactly between binary, octal, decimal and hexadecimal using BigInt. Input is validated against the selected base, with a limit of 4,096 digits.

Parameters

Enter the number to convert (digits valid for the selected base)

The base of the input number

Results

Decimal (Base 10)
255

Decimal representation

Other results (5)
Binary (Base 2)
1111 1111

Binary representation with 4-bit grouping

Octal (Base 8)
377

Octal representation

Hexadecimal (Base 16)
0xFF

Hexadecimal representation with 0x prefix

Bit Length8

Number of bits required to represent this number

As Byte (0x00–0xFF)
0xFF

Single-byte hex representation

Example input and result

255
1111 1111

Integer input only, up to 4,096 digits. Negative values use a minus sign; this is not a fixed-width two’s-complement representation.

Why Choose Number Base Converter

Convert signed integers exactly between binary, octal, decimal and hexadecimal using BigInt. Input is validated against the selected base, with a limit of 4,096 digits.

How to Use

  1. 1Enter a signed integer using valid digits for the source base.
  2. 2Select binary, octal, decimal or hexadecimal as the input base.
  3. 3Copy the converted integer; binary output includes four-digit groups.

Frequently Asked Questions (FAQ)

Can I convert an integer larger than the JavaScript safe range?

Yes. BigInt preserves integer values beyond 9,007,199,254,740,991. Fractions and scientific notation are not accepted; input is limited to 4,096 digits.

How are negative numbers represented?

A minus sign is shown before the magnitude. For example, decimal -10 becomes binary -1010. This is not a fixed-width two’s-complement encoding.

Can I include a prefix?

The matching prefixes 0b, 0o and 0x are accepted for binary, octal and hexadecimal. Digits outside the selected base and trailing text are rejected.

Authoritative References & Sources

MDN — BigInt

View Source