Number Base Converter

Convert between binary, octal, decimal, and hexadecimal.

Category: Converters

When to use?

Use it to convert a color code or memory address hex value to decimal, or to view a number in binary for bitwise operations.

How to use

  • Enter a number and choose its source base.
  • See it converted to binary, octal, decimal, and hex.

Input Explanation

Choose the reference number (e.g. 255) and its current base (2, 8, 10, 16).

Calculation Basis

It parses the input to a decimal integer with parseInt(value, radix), then converts to the target base string with toString(radix).

Usage Examples

  • Hex → decimal - Convert a color code or memory address hex value to decimal.
  • Decimal → binary - Convert a number to binary for bitwise operations.
  • Check bit masks - Convert a flag value to binary to read each bit's meaning.

Examples

  • 255 (decimal) → 11111111 (binary), 377 (octal), FF (hex)
  • Hex FF → decimal 255, binary 11111111, octal 377

Cautions

  • Malformed source data can cause parsing errors or broken output.
  • A mismatched encoding standard or complex nested data may break or drop the structure.

Guides

How base conversion works

It converts decimal to binary, octal, and hexadecimal, or back. For example, 255 (decimal) is FF (hex) and 11111111 (binary).

Dev/network uses

Common for color codes (HEX), memory addresses, bitwise operations, and network mask calculations. Pair with the color converter to check a HEX color's decimal value.

FAQ

Which bases are supported?

Binary (BIN), octal (OCT), decimal (DEC), and hexadecimal (HEX).

Can it convert negative numbers?

Yes, it converts negatives and shows the sign in the result.

What is a number base?

The number of symbols used per digit. Decimal uses 0–9; hex uses 0–F.

Do I need the 0x prefix for hex?

You choose the base directly, so enter only the number without a prefix like 0x.

Related Tools

  • ASCII Code Converter - Convert between characters and ASCII codes (decimal/hex/binary).
  • Unicode Converter - Convert a character to its Unicode code point (U+XXXX), or a code point to a character.
  • Hash Generator - Convert text into SHA-1, SHA-256, and SHA-512 hashes.
  • URL Encode / Decode - Encode text into URL-safe form (%XX) or decode an encoded URL back to text.
  • Base64 Converter - Encode text to Base64 or decode a Base64 string back to text.
  • HTML Escape / Unescape - Convert HTML special characters to entities, and restore entity strings back to characters.