/tallsystem

Number Base Converter (binary, hex, decimal)

Convert numbers between binary (2), octal (8), decimal (10) and hexadecimal (16), with big-number support.

How it works

Type a number in one of the fields and it is converted to decimal, binary, octal and hexadecimal at the same time. The tool uses arbitrary-size integers (BigInt), so very large numbers work too. Invalid digits for the base are flagged. Everything is calculated locally in your browser.

About this tool

The number system converter turns numbers between binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16), plus custom bases from 2 to 36. Handy when working with bitmasks, Unix permissions, CSS colours, memory addresses, IPv6 or low-level protocols. It also handles signed numbers via two’s complement, shows the bit pattern, and lets you see the number in all four common bases at once. All calculation is in the browser; no data is sent to a server.

How to use it

  1. Enter the number in the format you know (dec, hex, bin or oct).
  2. The tool automatically shows the value in every other base.
  3. Use the "custom base" field for bases 2–36 (e.g. base 32 for Crockford).
  4. Enable two’s complement for signed 8-, 16-, 32- or 64-bit integers.

Examples

Decimal to hex
Input255
OutputBIN: 11111111 OCT: 377 HEX: FF
Unix permissions
Inputchmod 755
OutputBIN: 111 101 101 = rwx r-x r-x
Octal fits Unix permissions perfectly because each digit encodes three bits (rwx).
Two’s complement 8-bit
Input-1
OutputBIN: 11111111 HEX: FF (as signed 8-bit = -1)

Common use cases

  • Convert Unix permissions between octal codes and rwx notation.
  • Compute CSS colours from hex to rgb() and back.
  • Debug protocols and file formats by reading binary bit patterns.
  • Convert hexadecimal memory addresses in C, Rust or assembly.
  • Teach CS students how numbers are represented.

Frequently asked questions

How large a number can the tool handle?
We use BigInt, so numbers up to several thousand digits are supported without precision loss. Regular JavaScript numbers (Number) are limited to 2^53, but BigInt has no practical upper bound.
What is two’s complement?
The standard way to represent negative integers in computers. Invert all bits and add 1. So -1 in 8-bit is 11111111, the same bit pattern as unsigned 255. All arithmetic works correctly across signs with the same add/sub instructions.
Why do programmers prefer hex over binary?
One hex digit encodes exactly 4 bits (0–F = 0000–1111), so a byte is two easy characters (FF) instead of eight in binary (11111111). Hex is shorter, easier to read aloud, and trivial to convert to/from bits by hand.
Can I convert floating-point numbers?
This tool only handles integers. For IEEE 754 floats (float32/float64) you need a dedicated tool that shows mantissa, exponent and sign separately. We’re considering adding one.

Technical background

Number representation: in base b we use the digits 0 to b-1, and each position represents a power of b. Decimal (b=10) is standard for humans because we have 10 fingers. Computers use binary (b=2) because transistors have two stable states (off/on). Octal (b=8) and hexadecimal (b=16) are convenient shortforms since 8 = 2³ and 16 = 2⁴, letting a group of binary digits be written as one hex or oct digit. For bases over 10 we use A–Z: A=10, B=11, ..., Z=35, so ASCII lets you go up to base 36. Base 32 (Crockford) and base 64 are popular for URL-safe IDs, while base 58 (Bitcoin) and base 62 are used by URL shorteners. Two’s complement is the algorithm for signed integers: bit pattern x is read as positive if the top bit is 0, else as x - 2ⁿ where n is the bit count. The upshot is that addition and subtraction work identically regardless of sign, whereas one’s complement (bit inversion) needs separate carry handling.