Skip to content

Number Base Converter

Enter a number in any base from 2 to 36 and see it converted to binary, octal, decimal and hexadecimal at once, exact even past the point where JavaScript numbers normally start losing precision.

  • Converts to binary, octal, decimal and hex at once
  • Accepts any source base from 2 to 36
  • Exact for numbers beyond 2^53
  • Supports negative numbers
  • Runs fully client-side

Converter

Converted locally, nothing uploaded

Binary

Octal

Decimal

Hexadecimal

How to convert a number between bases

  1. 01

    Enter the number

    Type the number using the digits valid for its source base.

  2. 02

    Pick the source base

    Choose the base the number is currently written in — binary, octal, decimal, hex, or any base from 2 to 36.

  3. 03

    Read the conversions

    The equivalent value in binary, octal, decimal and hex appears immediately.

Why "exact past 2^53" is worth calling out#

JavaScript's regular numbers are IEEE 754 doubles, which can only represent integers exactly up to 2^53 (about 9 quadrillion). A naive base converter built on parseInt() and .toString(base) silently loses precision past that point — the input and output stop matching without any error or warning. This tool parses and converts using BigInt arithmetic instead, so a 64-bit value like a hash fragment or a large ID converts exactly, no matter how many digits it has.

Why the source base goes up to 36, not just 16#

Binary, octal, decimal and hex (bases 2, 8, 10, 16) cover the vast majority of real use, but any base up to 36 is supported because that is the natural ceiling: base 36 uses every digit 0-9 plus every letter a-z, and there are no more single-character symbols left after that. Bases above 10 reuse letters as digits — base 16 uses a-f, base 36 uses a-z — matching the same convention used by URL shorteners and compact ID encodings.

A note on negative numbers#

A leading minus sign is preserved through the conversion — "-255" in decimal converts to "-ff" in hex, not to a two's-complement bit pattern. This matches how the number would be written in code or in most other reference converters, rather than how it would be stored in a fixed-width binary register.

Frequently asked questions

Does this stay accurate for very large numbers?

Yes — conversion uses BigInt arithmetic, so it stays exact well past 2^53, the point where JavaScript's regular number type starts losing precision.

Can I convert from bases other than binary, octal, decimal or hex?

Yes, any base from 2 to 36 is supported as the source base.

How are negative numbers handled?

A leading minus sign carries through to every output base — for example -255 in decimal becomes -ff in hex, not a two's-complement bit pattern.

Is my input sent anywhere?

No. The conversion runs entirely in your browser — nothing is uploaded or logged.

Developers

UUID Generator

Generate cryptographically random UUID v4 or time-ordered UUID v7, in bulk.

Developers

Base64 Encoder & Decoder

Encode and decode Base64 with correct UTF-8 handling, including the URL-safe alphabet.

Developers

ULID Generator

Generate ULIDs — sortable by creation time like UUID v7, but Crockford Base32 instead of hex.