Edit any number in binary, octal, decimal, or hexadecimal — all other representations update instantly. Supports integers, fractional values, and negative numbers. Precision up to 12 fractional digits.
Every number system is defined by its base (radix). The decimal system (base‑10) uses ten digits, binary (base‑2) uses two digits, octal (base‑8) eight digits, and hexadecimal (base‑16) sixteen digits (0‑9 plus A‑F). This real‑time converter lets you explore how the same numeric value is represented across these four fundamental bases — including fractional parts.
A number \( N = d_{n-1} \dots d_0 . d_{-1} d_{-2} \dots \) in base \( b \) equals:
\( N = \sum_{i=-m}^{n-1} d_i \cdot b^i \)
For conversion to another base, we first convert to decimal (the universal intermediate), then apply the multiplication/division method for fractional parts. Because some decimal fractions (e.g., 0.1) have infinite binary expansions, our tool displays up to 12 fractional digits — sufficient for most engineering and educational tasks.
| Feature | Specification |
|---|---|
| Integer range | Up to ±253 (JavaScript safe integer limit) – far beyond typical needs. |
| Fractional digits | Maximum 12 digits after radix point; intermediate decimal uses double precision. |
| Negative numbers | Fully supported: prefix with '-' (e.g., -1011.01 in binary). |
| Validation | Illegal digits (e.g., '2' in binary) show an error and prevent propagation until corrected. |
Enter 0.1 in the decimal field. Observe its binary representation: approximately 0.0001100110011… (repeating). Because binary cannot represent 0.1 exactly, any arithmetic accumulates rounding errors. This tool visualizes the root cause and is an excellent teaching resource for IEEE 754 floating‑point behaviour.
The converter listens to input events on all four fields. When a field changes:
Invalid inputs (e.g., "102" in binary) show a contextual error message and stop propagation until corrected, preserving the last valid state of other fields.
Not all decimal fractions can be represented exactly in binary (e.g., 0.1). The converter truncates repeating fractions to 12 digits — this matches the behavior of most programming languages when printing floating‑point numbers. For critical applications (finance, scientific computing), consider using decimal arithmetic libraries.