DEV Community

dayu2333-jinyul
dayu2333-jinyul

Posted on

I Built a Binary/Hex/Decimal Converter Widget Because Every Other One Has Ads

I needed a binary converter while debugging a bitmask. Every search result was either an ad farm or needed 3 clicks to convert one number.

So I built a clean one you can embed anywhere:

<iframe src="https://bintranslate.com/widget-embed.html"
  width="100%" height="420"></iframe>
Enter fullscreen mode Exit fullscreen mode

What it does

  • Binary ↔ Decimal ↔ Hex ↔ Octal in all directions
  • Shows conversion steps (not just the answer)
  • Pure client-side JS, no API, no tracking
  • 16-bit and 32-bit modes

The conversion logic

Binary to decimal is just parseInt(str, 2). The interesting part is showing the steps — positional notation with the powers of 2 — so it's actually useful for students and tutorial sites.

Live converter: https://bintranslate.com/widget-embed.html
Source: https://github.com/dayu2333-jinyul/bintranslate-tools

No ads, no signup, no 47 tracking scripts. Just an iframe.

Top comments (1)

Collapse
 
topstar_ai profile image
Luis Cruz

I appreciate how you've broken down the conversion logic, especially the part about showing the steps using positional notation with powers of 2 - this is indeed a valuable feature for educational purposes. The use of parseInt(str, 2) for binary to decimal conversion is straightforward, but handling the step-by-step display must have required some thoughtful implementation. Have you considered adding support for floating-point numbers or other numeric systems, and how might that impact the complexity of the conversion logic?