Sign up

Number Base

Convert between Binary, Octal, Decimal, and Hexadecimal.

Input Configuration

Enter a number and select its current base.

Prefixes like 0x / 0b / 0o and underscores are accepted.
Conversion Complete

Enter a number to convert.

Decimal Result:

—

Converted Bases
—

About this topic

Binary (Base 2) The language of computers.

Uses only two digits: 0 and 1. Every value in a computer's memory is ultimately stored as a sequence of binary bits. It is the simplest positional numeral system.

Key formulas & rules

  • •Uses digits 0 and 1
  • •Each position represents a power of 2
  • •Prefixed with 0b in code
  • •A group of 8 bits is a byte
  • •Computers use it due to transistor states (on/off)
  • •Bitwise operations are performed in binary

Examples

Input Output Note
1010 10 8 + 0 + 2 + 0
1111 15 8 + 4 + 2 + 1
100000 32 2⁵
0b101 5 Prefixed

Real-world uses

Computer logic Memory addressing Bitwise operations
Octal (Base 8) A compact shorthand for binary.

Uses digits 0 through 7. Before hexadecimal became dominant, octal was widely used in computing because it neatly groups binary bits into sets of three.

Key formulas & rules

  • •Uses digits 0-7
  • •Each position is a power of 8
  • •Prefixed with 0o in code
  • •One octal digit = 3 binary bits
  • •Used in Unix file permissions
  • •Less common in modern systems

Examples

Input Output Note
10 8 1 × 8 + 0
77 63 7 × 8 + 7
100 64 8²
0o17 15 Prefixed

Real-world uses

Unix permissions Compact binary representation Legacy systems
Hexadecimal (Base 16) The standard for human-readable memory.

Uses digits 0-9 and letters A-F. It is the most popular base for representing computer memory because it groups binary into sets of four, making it much shorter than binary.

Key formulas & rules

  • •Uses 0-9 and A-F
  • •Each position is a power of 16
  • •Prefixed with 0x in code
  • •One hex digit = 4 binary bits
  • •Used for memory addresses and color codes
  • •Base of HTML/CSS colors

Examples

Input Output Note
A 10 A represents 10
FF 255 Max 8-bit value
100 256 16²
0x1A 26 Prefixed

Real-world uses

Color codes (#FFFFFF) Memory dumps URL encoding
Arbitrary Precision Handling numbers far larger than standard integers.

Standard JavaScript numbers lose precision above 2⁵³. This calculator uses BigInt to parse and convert numbers up to 200 digits, preventing overflow and precision loss.

Key formulas & rules

  • •No floating-point rounding errors
  • •Supports numbers up to 200 digits
  • •Uses native BigInt parsing
  • •Validates character sets strictly
  • •Accepts prefixes (0x, 0b, 0o)
  • •Rejects invalid digits for the base

Examples

Input Output Note
1000 digits Supported BigInt
2⁶⁴ Exact Precision preserved
0xFFFFFFFF 4294967295 32-bit max
Invalid 2 Error 2 is not binary

Real-world uses

Cryptography Large-scale computing Precise physics

Modes & formulas

1

Base Conversion

• Enter a number and select its current base. • Number bases represent values using different sets of digits. Binary uses 0-1, Octal uses 0-7, Decimal uses 0-9, and Hexadecimal uses 0-9 and A-F. • The calculator validates the digits and converts through base 10 to all other formats.
Convert: Base X → Decimal → Base Y

Conversion works by first parsing the input in base X to a decimal integer (using BigInt), then formatting that integer in base Y. Common prefixes (0x, 0b, 0o) and underscores are accepted.

How to use it

Enter a number, pick its current base, and the tool instantly displays its representation in Binary, Octal, Decimal, and Hexadecimal.

Frequently asked questions

What is the largest number I can convert?
Up to 200 digits. BigInt handles arbitrary precision, but the tool caps input at 200 digits for readability.
Why is 0x commonly used for hex?
The '0x' prefix tells parsers to interpret the following digits as hexadecimal. Similarly, 0b for binary and 0o for octal.
What is a number base?
The number of unique digits (including zero) used to represent numbers in a positional numeral system.
Why do computers use binary?
Because digital circuits have two states: on (1) and off (0). Binary maps perfectly to transistor logic.
Why do programmers use hexadecimal?
It is much shorter and more human-readable than binary. One hex digit represents exactly four binary bits (a nibble).
What are the letters A-F in hexadecimal?
They represent the numbers 10, 11, 12, 13, 14, and 15, because base 16 needs 16 unique single-character digits.

Related calculators

Read the full Number Base guide — examples & 18 FAQs