Allin1Tool
ConvertersRuns in your browser

Number Base Converter

Convert whole numbers between any bases from 2 to 36, computed with BigInt so long hexadecimal values keep every digit.

Share:

Number Base Converter workspace

Converter Inputs

Spaces and underscores are ignored. 0b, 0o and 0x prefixes are accepted. Invalid digits are rejected, not stripped.

Values of any size are handled with BigInt, so 64 one-bits give 18446744073709551615 exactly.

Applies to numeric results. Conversions themselves are computed at full precision.

Conversion Output

Enter a value — everything is computed in your browser.

Using Number Base Converter

  1. Type or paste the number you want converted.

  2. Select the base it is written in and the base you want it in, anywhere from 2 to 36.

  3. Read the converted value, plus the binary, octal, decimal and hexadecimal forms and the bit length.

  4. Copy any single row, or copy the whole result at once.

Any base from 2 to 36 converts to any other, with the four common bases and the bit length filled in alongside. A digit that does not belong to the source base halts the conversion and is named by position, rather than being quietly discarded to produce a plausible wrong answer.

This converts whole numbers between any two bases from 2 to 36. Whatever pair you pick, the result panel also fills in binary, octal, decimal and hexadecimal, plus the bit length of the value, since those four are usually what you need next anyway.

Invalid digits stop the conversion

The version this replaced silently deleted anything that wasn't a 0 or a 1 and converted whatever was left. Type 1012 and it answered 5. Paste hello101 and it also answered 5. Both answers are wrong, and 5 looks like a perfectly reasonable number to copy into a config file.

Now a digit that doesn't belong to the source base stops the conversion, and the message names it:

"2" (position 4) is not a valid base-2 digit. Base 2 allows 0-1.

A refusal with a position in it costs you five seconds. A wrong answer that looks right can cost considerably more.

Large values stay exact

Arithmetic runs on BigInt, not on the double-precision floats JavaScript normally uses. Doubles hold integers exactly only up to 2^53. Past that they start rounding, and a converter built on them quietly loses the low digits of long hexadecimal values. Those are exactly the values people paste in, since hashes and 64-bit identifiers are the reason anyone opens a base converter.

Sixty-four one-bits convert to 18446744073709551615, with every digit correct. There's no upper limit beyond your patience.

What the parser accepts

Spaces and underscores are treated as digit-group separators and discarded, so 1101_0110 and 1101 0110 both parse as 11010110. You can group your bits in fours or eights and the result won't change.

The prefixes 0b, 0o and 0x are accepted when they match the base you selected: 0x with base 16, 0b with base 2, 0o with base 8. Letter digits are case-insensitive going in and come back uppercase for any base above 10, so deadbeef and DEADBEEF count as the same input.

A leading minus sign is understood, and the sign is printed before any prefix: -0x1A, never 0x-1A.

Two conversions worked through

DEADBEEF from base 16 to base 10 gives 3735928559. The panel adds the binary form 11011110101011011011111011101111, the octal 0o33653337357, and a bit length of 32. That bit length is the quickest way to confirm the value fits a 32-bit register with nothing to spare.

Base 36 uses the digits 0-9 followed by A-Z, one symbol for every value from zero to thirty-five. ZZ in base 36 is 35 × 36 + 35 = 1295, and the same 3735928559 written in base 36 is only seven characters: 1PS9WXB. Short-link services use it for exactly that compactness.

Where this is the wrong tool

Integers only. There's no fractional support. Type 1.5 and the full stop is rejected as an invalid digit, because a binary fraction is a different problem with different rounding behaviour.

No two's complement. A negative number is shown as a minus sign in front of its magnitude. That's the mathematical answer, but it isn't what a debugger shows you: −1 in a 32-bit register reads FFFFFFFF, and nothing on this page will produce that. Sign extension depends on a register width, and the tool is never told one.

No byte-order or encoding work. Converting a hex value tells you its numeric size. It doesn't tell you how the value sits in memory or what text it might decode to.

Related developer utilities

Frequently asked

What happens if I type a digit the base does not allow?

The conversion stops and the message names the character and its position — a `2` at position 4 in a base-2 number, for instance. Nothing is silently stripped and no answer is invented.

Are very large numbers handled exactly?

Yes. Arithmetic runs on BigInt rather than floating point, so values past 2^53 keep every digit; sixty-four one-bits convert to 18446744073709551615.

Can I paste values with 0x prefixes or underscores in them?

Yes. Spaces and underscores are discarded as digit separators, and the 0b, 0o and 0x prefixes are accepted when they match the base you selected.

Does it show two's complement for negative numbers?

No. A negative value is printed as a minus sign in front of its magnitude, so you will not see the FFFFFFFF a 32-bit debugger shows for −1. Register width is never supplied to the tool.