ToolLaunchpad
Converters

Number Base Converter

Type a number into any field and all the others update instantly. Works with binary, octal, decimal, hexadecimal and a custom base, with integers of any size.

Number Base ConverterRuns in your browser

  • 0Bit length
  • 0Bytes
  • 0Decimal digits

Runs entirely in your browser. Nothing you enter is uploaded or stored.

How to use the number base converter

Type or paste a number into any of the fields: decimal, hexadecimal, octal, binary or the custom base. Every other field updates as you type, so you never need a convert button.

  • Prefixes are accepted: 0x in the hex field, 0o in the octal field and 0b in the binary field. In the decimal field, any of the three prefixes switches to that base, so pasting 0xFF there works too.
  • Separators such as underscores and spaces are ignored, so 1111_0000, 1_000_000 and DEAD BEEF are fine.
  • Negative numbers start with a minus sign and are converted as sign plus magnitude.
  • Custom base accepts any base from 2 to 36, using the digits 0-9 followed by the letters a-z.

Invalid input is reported precisely, for example "9 is not a valid octal digit", and the other fields keep their last valid value.

Worked example

DecimalHexadecimalOctalBinaryBase 36
255FF3771111 111173
129550F24170101 0000 1111ZZ
3735928559DEADBEEF3365333735732 bits1PS9WXB
-42-2A-52-0010 1010-16

Large values stay exact: 18446744073709551616 (2^64) is 10000000000000000 in hex, a 1 followed by 16 zeros, and needs 65 bits.

How positional number systems work

In a positional system each digit is multiplied by a power of the base. Hex 2F means 2 × 16 + 15 = 47, and binary 101 means 1 × 4 + 0 × 2 + 1 = 5. Bases above 10 borrow letters, so in hex A to F stand for 10 to 15 and base 36 runs all the way to Z = 35.

Hexadecimal is popular in programming because one hex digit is exactly four bits (a nibble), so a byte is always two hex digits. Octal groups three bits per digit, which is why Unix file permissions like 755 are written in octal.

Ordinary JavaScript numbers are only exact up to 2^53 - 1 (9007199254740991). This converter uses BigInt instead, so 128-bit IDs, cryptographic values and other long integers convert without rounding.

Common mistakes

  • Using digits that do not exist in the base. Octal only has 0-7 and binary only 0 and 1. A stray 8 or 2 is the most frequent error.
  • Expecting two's complement. Negative numbers are shown with a minus sign. A 32-bit register holding -1 shows FFFFFFFF, which is the same bit pattern read as an unsigned number.
  • Confusing the letter O and zero. In base 36 they are different digits; this tool treats letters case-insensitively but never reads O as 0.
  • Fractions. Only whole numbers are supported. Remove the decimal point or convert the parts separately.

A quick way to check a result by hand: every hex digit maps to exactly four binary digits, so FF must become 1111 1111 and 2A must become 0010 1010. With nibble grouping switched on, the binary field lines up with the hex digits one group at a time.

For colour codes like #FF8800, the color converter splits hex into RGB channels for you.

Frequently asked questions

How do I convert hexadecimal to decimal?

Type or paste the hex value into the hexadecimal field, with or without the 0x prefix. The decimal field shows the result immediately, along with binary, octal and the custom base.

Can it convert very large numbers?

Yes. The converter uses JavaScript BigInt, so integers with hundreds of digits are converted exactly without rounding, unlike ordinary floating-point numbers.

How are negative numbers handled?

A leading minus sign is kept and the magnitude is converted, so -42 becomes -2A in hex. The tool does not produce two's complement bit patterns.

What is the highest base supported?

Base 36, which uses the digits 0 to 9 and the letters A to Z. Letters are accepted in upper or lower case.

What does bit length mean?

It is the number of binary digits needed to write the value without leading zeros. For example 255 has a bit length of 8 and 256 needs 9 bits.

Can I paste numbers with underscores or spaces?

Yes. Underscores and spaces are treated as digit separators and ignored, so values copied from code like 1_000_000 or 0xDEAD_BEEF work directly.

More free Launchpad tools