Binary Calculator
Published: November 11, 2017 · Last updated: November 11, 2017
Overview
I built this simple frontend binary calculator using TypeScript to convert numbers between decimal, binary, and hexadecimal formats on the fly. It’s a handy little tool for quickly checking base representations without needing to manually run bitwise math in your head.
How It Works
You can enter a number in any of the three supported formats:
- Decimal (base 10): Standard everyday numbers.
- Binary (base 2): Standard 0s and 1s.
- Hexadecimal (base 16): Numbers 0–9 plus letters A–F.
The calculator automatically computes and fills in the corresponding values in the other two fields in real time. It also handles input validation behind the scenes, restricting inputs to valid characters based on the active numeral system.
Under the hood, I wrote this in TypeScript to keep the type safety clean and ensure the component is easy to reuse across the app.
Demo
▶️ Try the Binary Calculator Demo