Developer Tools

Number Base Converter

Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, with exact big-number support.

Binary1111 1111
Octal377
Decimal255
HexadecimalFF
Base 3673

Two's complement (fixed width)

How the same bits read as unsigned and signed integers. Needs at least 9 bits as a signed value.

BitsHEXUnsignedSigned
8FF255-1
1600FF255255
320000 00FF255255
640000 0000 0000 00FF255255

Roman numerals

Enter a number from 1 to 3999, or a Roman numeral such as MCMXCIV.

MMXXVI

About this tool

Computers store everything as binary, but programmers read and write numbers in several bases: hexadecimal for memory addresses, colors and byte values, octal for Unix file permissions, binary for bit flags and masks. This converter turns a number in any base from 2 to 36 into binary, octal, decimal, hexadecimal and a base of your choice, all at once.

It uses arbitrary-precision integers, so 64-bit values, cryptographic constants and numbers with hundreds of digits convert exactly, with no rounding. A two's-complement table shows how the same bits read as signed and unsigned 8-, 16-, 32- and 64-bit integers, and a Roman numeral converter covers 1 to 3999.

How to use Number Base Converter

  1. Choose the base of your input: binary, octal, decimal, hexadecimal, or type any base from 2 to 36.
  2. Enter the number. Prefixes such as 0x, 0b and 0o, a minus sign, and separators like spaces, underscores or commas are accepted.
  3. Read the results in all bases. Toggle "Group digits" to split binary into nibbles and decimal into thousands; Copy always copies the ungrouped value.
  4. Check the two's-complement table to see the value as signed and unsigned fixed-width integers.
  5. Use the Roman numerals box to convert in either direction.

Examples

Decimal 255

Input
255 (decimal)
Result
Binary 1111 1111 · Octal 377 · Hex FF

Negative number in 8 bits

Input
-1 (decimal)
Result
8-bit pattern FF, unsigned 255, signed −1

In two's complement, all bits set means −1.

Largest unsigned 64-bit integer

Input
18446744073709551615 (decimal)
Result
FFFFFFFFFFFFFFFF (hex)

Exact, because the converter uses BigInt instead of floating-point numbers.

How base conversion works

In base b, each digit is worth b times the digit to its right. Binary 1011 is 1×8 + 0×4 + 1×2 + 1×1 = 11. To convert decimal to another base, divide repeatedly by the base and read the remainders backwards: 11 ÷ 2 = 5 r1, 5 ÷ 2 = 2 r1, 2 ÷ 2 = 1 r0, 1 ÷ 2 = 0 r1 → 1011.

Hexadecimal is popular because one hex digit is exactly four bits, so a byte is always two hex digits (00 to FF). Octal digits are three bits each, which matches the read/write/execute triplets of Unix permissions: chmod 755 means rwx r-x r-x.

Two's complement in a nutshell

  • Fixed-width integers store negative numbers by counting down from 2ⁿ: in 8 bits, −1 is 255 (FF), −128 is 128 (80).
  • A signed n-bit integer ranges from −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1, for example −128 to 127 for 8 bits and about ±2.1 billion for 32 bits.
  • The same byte C8 is 200 as an unsigned value and −56 as a signed one; the table shows both so you can debug overflow and sign errors.

Frequently asked questions

Everything you need to know about this tool and data security.

What is the largest number it can convert?

There is no fixed limit; numbers with thousands of digits work. Conversion is exact for whole numbers. Fractions are not supported.

Which letters are used for bases above 10?

A to Z stand for 10 to 35, so base 36 uses 0–9 and A–Z. Input is case-insensitive.

Why does 0x prefix appear in code but not in the result?

The prefix only tells a programming language which base follows (0x hex, 0b binary, 0o octal). It is accepted in the input and left out of the output so you can paste it wherever you need.

Why are Roman numerals limited to 3999?

Standard Roman numerals have no symbol above M (1000) and do not repeat a symbol more than three times, so MMMCMXCIX (3999) is the largest. There is also no zero.

Is my data safe when using this tool?

Yes, 100% safe. This tool operates entirely inside your web browser using client-side JavaScript and WebAssembly. Your data never touches any external server.