NumForge LogoNumForge
Explore
Base Conversion ToolsFree Interactive Tool

Base-4 Converter

Convert numbers into and out of quaternary (base 4) notation using digits 0, 1, 2, and 3. Designed for software developers, electrical engineers, students, and computer architecture researchers requiring deterministic client-side accuracy.

Engine: Client-Side Verified (0ms Latency)

Enter digits 0, 1, 2, 3.

Calculated Output

Primary Representation
Calculating...

Step-by-Step Mathematical Proof

Active Derivation
Ready. Enter input above to generate derivation.
Concept

What Is Base-4 Converter?

Quaternary (base 4) uses four digits: 0, 1, 2, and 3. Because 4 = 2^2, each quaternary digit maps directly to exactly two binary bits.

Methodology

How Does It Work?

Evaluate positional weights of powers of 4 (1, 4, 16, 64, 256) or map each digit directly to 2 binary bits (0=00, 1=01, 2=10, 3=11).

Formula & Rules

Mathematical Algorithm

N_{10} = \sum_{i=0}^{n-1} d_i 4^i \quad (d_i \in \{0, 1, 2, 3\})
Worked Problem

Step-by-Step Example

Convert 312_4 to decimal: (3 × 4^2) + (1 × 4^1) + (2 × 4^0) = 48 + 4 + 2 = 54_{10}.

Important Rules & Edge Cases

  • Only digits 0, 1, 2, 3 are valid.
  • Each digit corresponds to 2 binary bits.

Practical Applications in Engineering

  • DNA sequence encoding (mapping nucleotides A, C, G, T to 0, 1, 2, 3).
  • Hilbert curve spatial data indexing in GIS systems.

Common Mistakes to Avoid

  • Caution: Entering 4 or higher.
FAQ

Frequently Asked Questions

How is base 4 related to binary?

Each base-4 digit corresponds to exactly 2 binary bits (00, 01, 10, 11).