Base Number Converter

Convert numbers between binary, octal, decimal, and hexadecimal bases instantly.

Binary (BIN) (2)
---
Octal (OCT) (8)
---
Hexadecimal (HEX) (16)
---

JavaScript Examples

Binary Operations & Bit Manipulation

Common binary operations in JavaScript for flag handling and permissions

// Working with binary flags
const READ_PERMISSION    = 0b100  // 4
const WRITE_PERMISSION   = 0b010  // 2
const EXECUTE_PERMISSION = 0b001  // 1

// Combining flags using bitwise OR
let userPermissions = READ_PERMISSION | WRITE_PERMISSION // 0b110 (6)

// Checking permissions using bitwise AND
const canRead = (userPermissions & READ_PERMISSION) !== 0    // true
const canExecute = (userPermissions & EXECUTE_PERMISSION) === 0 // false

// Toggle permission using XOR
userPermissions = userPermissions ^ EXECUTE_PERMISSION // Add execute
console.log(userPermissions.toString(2)) // '111'

// Practical example: RGB color channels
const red = 0b11111111   // 255
const green = 0b10101010 // 170
const blue = 0b00000000  // 0
console.log(`rgb(${red}, ${green}, ${blue})`) // "rgb(255, 170, 0)"

How to Use Our Base Number Converter

  1. Select BaseChoose the base of your input number (Binary, Octal, Decimal, or Hexadecimal).
  2. Enter NumberType your number in the input field. The converter will validate it automatically.
  3. View ResultsSee instant conversions to all other number bases.
  4. Copy ResultsClick the copy button next to any result to copy it to your clipboard.

Key Features

Real-time Conversion

Instantly convert between different number bases as you type.

Multiple Base Support

Support for Binary (2), Octal (8), Decimal (10), and Hexadecimal (16).

Developer Friendly

Includes common programming prefixes (0b, 0o, 0x) and code examples.

Input Validation

Automatic validation ensures correct input for each base system.

Popular Use Cases

Software Development

  • Working with binary data and bitwise operations
  • Debugging memory addresses in hexadecimal
  • Converting color codes between formats

System Administration

  • Managing file permissions in octal
  • Network configuration and IPv6 addresses
  • Working with binary configuration flags

Related Tools

Helpful Resources & Guides