Base Converter

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.

Binary base 2
Digits: 0,1 ; radix point '.' allowed
Octal base 8
Digits: 0–7 ; radix point '.' allowed
Decimal base 10
Digits: 0–9 ; standard decimal point
Hexadecimal base 16
Digits: 0–9, A–F (case‑insensitive)
Current decimal value: 3.14
Updates in real time
Quick examples:
Privacy first: All conversions are performed locally in your browser. No data leaves your device.
Conversion insight
Edit any field above — the engine converts the number to decimal using radix expansion, then recomputes all other bases. Fractional parts are truncated to 12 digits for display.

Understanding Positional Notation & Floating‑Point Radix Conversion

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.

Mathematical foundation: from any base to decimal

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.

Why Real‑Time Conversion Matters

  • Programmer's aid: Instantly see how memory values (binary/hex) translate to decimal.
  • Educational exploration: Verify that 0.110 ≈ 0.00011001100112 and understand floating‑point rounding.
  • Embedded systems & networking: Hexadecimal and binary are essential for registers, MAC addresses, and bitmask design.
  • Debugging & data analysis: Convert logs or sensor data between bases on the fly.

Supported Features & Precision Guarantee

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.
Case study: Why does 0.1 + 0.2 produce 0.30000000000000004?

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.

How the Real‑Time Engine Works

The converter listens to input events on all four fields. When a field changes:

  1. It validates the entered string against the base's allowed digits (including optional sign and single decimal point).
  2. If valid, it parses the value to a high‑precision decimal number using positional expansion.
  3. It then converts that decimal value to the three other target bases using integer/fractional algorithms with a 12‑digit fractional limit.
  4. All fields update simultaneously without recursion loops, and the decimal preview shows the exact intermediate floating‑point value.

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.

Important: Floating‑point approximations

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.

Character set per base (case‑insensitive for hex)

  • Binary: 0, 1 and '.' (radix point), optional leading '-'
  • Octal: 0–7, '.' and optional '-'
  • Decimal: 0–9, '.' and optional '-'
  • Hexadecimal: 0–9, A‑F (or a‑f), '.' and optional '-'

Authoritative references: Conversion algorithms follow standards from Knuth's "The Art of Computer Programming", Vol 2, and IEEE 754-2019. Reviewed by the GetZenQuery mathematics team, last updated March 2026.

Frequently Asked Questions

Yes, integer parts up to 2^53 are lossless. For larger integers, floating‑point precision may drop, but typical programming tasks stay within safe limits.

Uppercase is conventional in computing (e.g., 0x1A). The input is case‑insensitive, but output is formatted in uppercase for readability.

The tool displays up to 12 fractional digits, which offers a good balance between accuracy and usability. For infinite repeating fractions, it truncates after 12 digits.

Click the "Clear All" button. All inputs will be emptied and the decimal preview resets.