início/dev/number-base

Number Base Converter Online

Binary, octal, decimal, hex

Como usar Base Numérica

  1. 1

    Enter a number

    Type a number in any supported base field — binary, octal, decimal, or hex.

  2. 2

    View conversions

    All base representations update in real time as you type.

  3. 3

    Copy any value

    Click copy next to the base you need for your code or documentation.

Perguntas frequentes

Is my data safe?
Yes. All processing happens entirely in your browser. Your data never leaves your device and is never uploaded to any server.
What number bases are supported?
Binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) — the four bases most commonly used in programming and computer science.
Why is hexadecimal so common in programming?
Hexadecimal is compact and maps cleanly to binary — each hex digit represents exactly 4 binary bits (a nibble), and two hex digits represent one byte. This makes memory addresses, color codes, and binary data much more readable than long binary strings.
What does the '0x' prefix in hex values mean?
'0x' is a conventional prefix in most programming languages (C, Python, JavaScript, Java) that tells the compiler or interpreter the following digits are hexadecimal. It has no mathematical meaning — 0xFF and FF both equal 255 in decimal.
Can this tool handle negative numbers?
This tool converts unsigned non-negative integers. Negative numbers require two's complement representation, which is base-specific and depends on word size (8-bit, 16-bit, 32-bit, etc.). For signed binary arithmetic, a dedicated two's complement tool is more appropriate.

Saiba mais

O que é Number Base?

Convert numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) instantly. Type in any field and all other representations update in real time. Useful for low-level programming, understanding memory addresses, working with network masks, embedded systems, and computer science coursework. No sign-up required — all conversions happen in your browser with no server involved.

Por que usar Number Base?

  • Real-time updates — type in any base field and all others update instantly, no button click needed.
  • All four common bases in one view — binary, octal, decimal, and hex side by side for easy comparison.
  • Handles large numbers — JavaScript's BigInt ensures accurate conversion for numbers beyond 32-bit range.
  • Useful for low-level work — essential for understanding bitwise operations, memory addresses, and color codes.
  • Completely private — all computation happens in your browser.

Casos de uso de Number Base

Bitwise operation debugging

Verify the result of AND, OR, XOR, and shift operations by viewing the binary representation of your operands and results side by side.

Network subnet masks

Convert subnet masks like 255.255.255.0 into binary to visualize which bits define the network versus host portions of an IP address.

Embedded systems programming

Microcontroller registers are often documented in binary or hex. Convert between formats when writing register configuration code in C or assembly.

Color code conversion

CSS hex color codes (#FF5733) are hexadecimal RGB values. Convert to decimal to see the individual red, green, and blue channel values (255, 87, 51).

Dicas e boas práticas

  • 💡Hexadecimal is 4x more compact than binary — each hex digit represents exactly 4 binary bits (nibble). This makes hex the preferred shorthand for binary values in code.
  • 💡Octal (base 8) is commonly used for Unix file permissions — chmod 755 means binary 111 101 101 (rwxr-xr-x in permission notation).
  • 💡In most programming languages, prefix hexadecimal literals with '0x', binary with '0b', and octal with '0o'. For example: 0xFF, 0b11111111, 0o377 all equal 255 in decimal.
  • 💡Two's complement representation for negative numbers is a separate concept — this converter handles unsigned integers. For signed binary arithmetic, consult a two's complement reference.

Como funciona

Conversion uses JavaScript's parseInt(value, fromBase) to parse the input in the source radix, then Number.prototype.toString(toBase) to format in each target radix. For numbers larger than Number.MAX_SAFE_INTEGER (2^53 - 1), BigInt is used to ensure exact conversion without floating-point precision loss. Binary output is grouped in 4-bit nibbles for readability. Input validation rejects characters that are invalid for the selected base (e.g., '2' through '9' are invalid in binary).