Number Base Converter

Enter a number in any base and instantly see its equivalent in binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Useful for debugging, understanding memory addresses, working with colour codes, file permissions, and bitmasks in software development.

Most current tools process data directly in your browser. If a tool requires external processing, it will say so clearly.

How to Use the Number Base Converter

  1. 1Select the base of your input number from the dropdown
  2. 2Type or paste your number into the input field
  3. 3The converted values appear instantly in all four bases
  4. 4Click the copy icon next to any result to copy it to the clipboard

Key Benefits

  • Converts across all four bases simultaneously — no need to convert twice
  • Validates input characters against the selected base in real time
  • Instant conversion as you type — no button press required
  • Each result is individually copyable for use in code or documentation

Frequently Asked Questions

What are binary, octal, decimal, and hexadecimal?

These are positional numeral systems that represent the same values using different bases. Binary (base 2) uses only 0 and 1 — the native language of digital hardware. Octal (base 8) uses digits 0–7, historically used for Unix file permissions. Decimal (base 10) uses digits 0–9, the standard human counting system. Hexadecimal (base 16) uses 0–9 and A–F, widely used for memory addresses, colour codes, and byte values.

Why do developers use hexadecimal?

Each hex digit represents exactly four binary bits, making hex far more compact than binary for byte-level data. One byte (8 bits) is exactly two hex digits (e.g., 0xFF). Memory addresses, HTML/CSS colour codes (#RRGGBB), CPU registers, and hash outputs are typically shown in hex because it is concise and maps cleanly onto binary. Reading 0x1F4A3C is far more practical than its 24-character binary equivalent.

What are valid characters for each base?

Binary accepts only 0 and 1. Octal accepts digits 0–7 (not 8 or 9). Decimal accepts digits 0–9. Hexadecimal accepts 0–9 and A–F (case-insensitive). If you enter an invalid digit — such as 9 in binary or G in hex — the converter shows an error rather than silently producing a wrong result.

How do Unix file permissions relate to octal?

Unix/Linux file permissions map to a three-digit octal number: each digit covers owner, group, and others, representing a 3-bit value (r=4, w=2, x=1). chmod 755 means owner has rwx (7), group has r-x (5), others have r-x (5). Understanding octal makes reading and writing permission strings intuitive for anyone working with Linux systems or shell scripts.

What are bitmasks and how do they use binary?

A bitmask is an integer where individual bits represent boolean flags. A permissions field might use bit 0 for read, bit 1 for write, and bit 2 for execute. Testing a flag uses a bitwise AND: value & 0b100 checks if bit 2 is set. Representing bitmasks in binary or hex makes bit positions visible at a glance, which is why developers regularly convert between bases when debugging flag logic.

What is the 0x prefix in hexadecimal?

The 0x prefix is a C-language convention indicating a hexadecimal literal in source code (e.g., 0xFF, 0x1A3C). Most languages (C, C++, Java, Python, JavaScript) use 0x for hex. Similarly, 0b is used for binary and 0o (or a leading zero) for octal. This tool accepts numbers without prefixes — just the raw digits — and shows results in standard format for each base.

Related Tools

Number Base Converter — Binary, Octal, Decimal, Hex | Utilikits | Utilikits