Web ToolBox

Number Base Converter

Real-time conversion between binary/octal/decimal/hex

Change number base

What is Number Base Converter?

A tool that instantly converts numbers between binary, octal, decimal, and hexadecimal systems. Essential for programming, computer science, and digital electronics work.

Enter a value in any base field and it automatically converts to all other base formats.

How to Use

You can input values in any field (binary, octal, decimal, or hexadecimal). The tool automatically converts your input to all other base formats.

Options

Format numbers - Displays long numbers with separators for better readability

  • On: Binary groups by 4 digits, octal by 3, decimal by 3, hexadecimal by 4
  • Off: Continuous display without separators

Use the copy button next to each field to copy the converted result to your clipboard.

Supported Number Bases

Base NameDigits UsedCommon Uses
Binary0-1Computer internal representation
Octal0-7UNIX file permissions, legacy code
Decimal0-9Everyday calculations, general use
Hexadecimal0-9, A-FMemory addresses, color codes
  • When on: Binary is separated every 4 digits, octal every 3 digits, decimal every 3 digits, and hexadecimal every 4 digits
  • When off: Numbers are displayed as continuous digits without separators
  1. Copy results: Click the copy button next to any field to copy the converted result to your clipboard

Use Cases

  • Convert number representations in code - Switch between 0x1A, 0b1010, and other base formats
  • Bit manipulation - View binary representation while working with bitwise operations
  • Memory address calculations - Convert between hexadecimal and decimal addresses

Important Notes

  • Input restrictions: Each base only accepts valid digits (e.g., binary accepts only 0 and 1)
  • Maximum value: Numbers exceeding JavaScript's safe integer range (2^53-1 = 9,007,199,254,740,991) cannot be accurately converted
  • Separators: Spaces or separators in input are ignored during conversion

How Base Conversion Works

Example: Converting decimal "42" to binary:

  1. 42 ÷ 2 = 21 remainder 0
  2. 21 ÷ 2 = 10 remainder 1
  3. 10 ÷ 2 = 5 remainder 0
  4. 5 ÷ 2 = 2 remainder 1
  5. 2 ÷ 2 = 1 remainder 0
  6. 1 ÷ 2 = 0 remainder 1

Reading remainders bottom-up: 101010 (binary)