Advertisement

Free Online Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal.

Waiting for input

Spaces and underscores are ignored. Prefixes such as 0x, 0o, and 0b are accepted when they match the input base.

Uses BigInt, so integers of any practical size keep full precision.

Binary
Octal
Decimal
Hexadecimal
Base 36

Base 2 is binary, base 8 is octal, base 10 is decimal, and base 16 is hexadecimal. Bases 3 to 35 use the digits 0-9 followed by letters A-Z, so base 36 is the highest supported.

Advertisement

About the Number Base Converter

A number base, or radix, is the count of distinct digits a numeral system uses. Binary (base 2) is how digital circuits store values. Octal (base 8) and hexadecimal (base 16) are compact ways to write binary because each digit maps to exactly three or four bits. Decimal (base 10) is the everyday system, and bases up to 36 appear in identifiers, encodings, and puzzles. This tool converts an integer between any two bases from 2 to 36.

How positional notation works

Each digit is multiplied by the base raised to its position, counting from zero on the right. For example, 1011 in binary is 1×8 + 0×4 + 1×2 + 1×1 = 11 in decimal. Hexadecimal uses letters for values above nine: A is 10, B is 11, up to F for 15. Base 36 uses all ten digits plus A through Z.

JavaScript's native Number type loses precision beyond 253−1. This converter uses BigInt instead, so large integers such as 128-bit identifiers, cryptographic constants, and database keys are converted exactly with no rounding. The parser validates every digit against the input base and reports the first invalid character. Negative values are supported with a leading minus sign.

Common uses include reading memory addresses and color values in hexadecimal, checking permission masks in octal, building packet dumps in binary, and generating short identifiers in higher bases. Remember that a conversion only changes the representation, not the value. If you paste a value with a prefix such as 0x, choose the matching base first; a mismatched prefix will be reported as an invalid digit.

How to use this tool

  1. Enter an integer in the number field.
  2. Set the input base from 2 to 36.
  3. Choose a custom output base, or read the standard binary, octal, decimal, and hex results.
  4. Copy an individual value or all results.

Frequently asked questions

Can I convert fractional numbers?

No. This tool converts integers only. Fractional values in another base use a radix point and a different conversion algorithm.

How large can my number be?

There is no fixed numeric limit because BigInt grows as needed. Very long inputs may be limited only by browser memory and patience.

Why was my hexadecimal value rejected?

Check that the input base is set to 16. Letters A-F are valid only in bases above 10, and a 0x prefix is accepted only when the input base is 16.

Sponsored
Find a bug? Report now