Number Conversion

🔢

Numbers Converter: Binary, Octal, Decimal, Hex & Base 2–36

Convert numbers between binary, octal, decimal, hexadecimal, and any base from 2 to 36. Instant, browser-based, no sign-up — supports arbitrarily large integers.

Number Base Conversion Tool

101010
Calculated
42 (Decimal (base 10)) = 101010 (Binary (base 2))
Same value in key bases
Binary (2)101010Octal (8)52Decimal (10)42Hex (16)2A

Quick number base reference

Common integer values in the four most-used bases — use the converter above for any base and any number.

Decimal (10)Binary (2)Octal (8)Hex (16)
0000
1111
81000108
10101012A
15111117F
16100002010
42101010522A
64100000010040
100110010014464
25511111111377FF
256100000000400100
1024100000000002000400

What are number bases (radixes)?

A number base (or radix) defines how many unique digit symbols a positional numeral system uses before it "wraps around" and adds a new place. Decimal (base 10) uses the digits 0–9; when you reach 9 and add one more, you carry into the tens place. Binary (base 2) uses only 0 and 1 — indispensable in digital electronics where a transistor is either off (0) or on (1). Hexadecimal (base 16) extends the digit set with A–F (representing 10–15) and compactly encodes four binary bits per hex digit, making it ubiquitous in memory addresses, color codes, and machine-level debugging.

This converter supports every integer base from 2 through 36 — the practical maximum when using the 10 Arabic numerals plus the 26 Latin letters as distinct digit symbols. Bases beyond 10 borrow letters: base 11 adds A (= 10), base 16 adds A–F (= 10–15), and base 36 uses A–Z (= 10–35). All conversions run locally in your browser using arbitrary-precision integer arithmetic, so there are no rounding errors and no upper limit on number size.

How number base conversion works

Every positional number can be expressed as a weighted sum of its digits. For a number written in base b with digits dn−1…d0 (most significant first), the decimal value is:

Conversion between any two bases uses decimal as an intermediary:

  1. Source → decimal: expand the digit-weight sum above to get an integer value.
  2. Decimal → target: repeatedly divide by the target base, collecting remainders; reading the remainders in reverse gives the target-base representation.

Example: convert 2A (hex, base 16) to octal (base 8). Step 1: 2×16 + 10 = 42 (decimal). Step 2: 42 ÷ 8 = 5 remainder 2; 5 ÷ 8 = 0 remainder 5 → read remainders in reverse → 52 (octal).

Key number bases explained

The bases you'll encounter most often in computing, mathematics, and everyday use.

Binary (base 2)

Digits: 0, 1

The native language of digital hardware. Every byte is 8 binary digits; 0xFF = 11111111. Used directly in bitwise operations, CPU registers, and boolean logic.

Octal (base 8)

Digits: 0–7

One octal digit = 3 binary bits. Common in Unix/Linux file permissions (chmod 755) and older minicomputer architectures. Increasingly replaced by hex but still widely seen in system programming.

Decimal (base 10)

Digits: 0–9

The universal human counting system. Used by default in all everyday arithmetic and most programming languages for integer literals. This converter uses decimal as the internal intermediary for all conversions.

Hexadecimal (base 16)

Digits: 0–9, A–F

One hex digit = 4 binary bits (a nibble); two hex digits = 1 byte. Found everywhere in computing: HTML/CSS color codes (#FF6900), memory addresses (0xDEADBEEF), SHA hashes, and IPv6 addresses.

Duodecimal (base 12)

Digits: 0–9, A, B

Naturally divisible by 2, 3, 4, and 6 — more factors than decimal. Influences everyday life in 12-hour clocks, 12 months, and the dozen. Studied by the Dozenal Society as a more convenient base for fractions.

Base 36

Digits: 0–9, A–Z

Uses all ten digits and all 26 letters, making it the maximum single-character-per-digit base. Used in URL shorteners, content IDs, and compact alphanumeric identifiers. JavaScript's Number.toString(36) produces base-36 strings.

Common number base conversions at a glance

Frequently needed pairs — use the calculator above for any value.

FromToGrouping ruleExample
Binary (2)Hex (16)Group 4 bits → 1 hex digit1010 1111 → AF
Binary (2)Octal (8)Group 3 bits → 1 octal digit101 010 → 52
Hex (16)Decimal (10)Digit × 16ⁱ, sum allFF → 255
Decimal (10)Binary (2)Divide by 2, collect remainders255 → 11111111
Decimal (10)Hex (16)Divide by 16, collect remainders1024 → 400

Who uses a numbers converter?

Software engineers and system programmers move between binary, octal, and hex when reading disassembly, setting file permissions (chmod), or inspecting memory dumps. Web designers convert hex color codes to decimal RGB values and back. Network engineers parse IPv6 addresses in hex. Computer science students verify homework converting between arbitrary bases. Cryptographers inspect hash outputs in hex or binary. Game developers use base-36 or base-32 for compact entity IDs. Anyone working with hex arithmetic or digital storage will find this converter a useful companion. All conversions run entirely in your browser — no data leaves your device.

Binary and hex: the programmer's shorthand

Binary and hexadecimal are not separate ideas — they are two views of the same bit pattern. Because 16 = 24, each hex digit maps exactly to a group of four binary bits (a nibble). This means you can convert between the two by inspection, without arithmetic: read four bits at a time and replace with the corresponding hex digit (or vice versa). Similarly, octal = 23, so each octal digit maps to three bits. This bit-grouping shorthand is why programmers overwhelmingly prefer hex over decimal when reading raw binary data — a 32-bit integer takes at most 8 hex digits but up to 10 decimal digits, and hex preserves byte boundaries.

Numbers Converter FAQ

? How do I convert binary to hexadecimal?

Group the binary digits into sets of four from the right (padding with leading zeros if needed), then replace each group with the corresponding hex digit: 0000=0, 0001=1, …, 1010=A, …, 1111=F. For example, 1010 1111AF. Or just enter the binary number in the converter above, set "From" to Binary and "To" to Hexadecimal.

? How do I convert decimal to binary?

Repeatedly divide the decimal number by 2 and record the remainders. Read the remainders bottom to top. Example: 42 ÷ 2 = 21 R0 → 21 ÷ 2 = 10 R1 → 10 ÷ 2 = 5 R0 → 5 ÷ 2 = 2 R1 → 2 ÷ 2 = 1 R0 → 1 ÷ 2 = 0 R1 → reading remainders in reverse: 101010.

? What digits are valid in bases above 10?

Bases 11–36 extend the digit set with letters A–Z (case-insensitive). A = 10, B = 11, C = 12, D = 13, E = 14, F = 15, …, Z = 35. Hexadecimal (base 16) uses 0–9 and A–F. Base 36 uses every digit and every letter. If you enter a character that is not a valid digit for the selected base, the converter shows a validation error and lists the allowed characters.

? Why does 0xFF equal 255 in decimal?

In hexadecimal, F = 15. 0xFF means F × 161 + F × 160 = 15 × 16 + 15 × 1 = 240 + 15 = 255. 255 is the maximum value of a single unsigned byte (8 bits all set to 1: 11111111 binary). Knowing that 0xFF = 255 is fundamental to understanding color channels (#RRGGBB), network masks, and raw memory values.

? What is the "0x" prefix in hexadecimal?

0x is a prefix convention used in C, C++, JavaScript, Python, and most other programming languages to signal that the following literal is in hexadecimal. It is not part of the number itself. When using this converter, enter only the digits (e.g. type FF, not 0xFF). Similarly, binary is sometimes prefixed with 0b in code — strip that before entering here.

? Does this converter handle very large numbers?

Yes. This converter uses JavaScript BigInt arithmetic, which handles arbitrarily large integers without floating-point rounding errors. There is no built-in upper limit — you can convert numbers with hundreds of digits accurately. (Very long inputs will naturally slow down the browser due to display rendering, not the math.)

Popular numbers unit conversions