站点名称:Flip Bits, Check Hex: A Calculator for Programmers
所属分类:全栈极客与开发辅助
相关标签: # programmer calculator # hex # bitwise # binary # developer tools
官方网址:https://www.9314.cn/tools/prog-calc/en/
进入网站站点介绍

I once stared at 0x3F and 0xC0 for ten minutes, counting bits on the screen with my finger. Which field was the high two bits, which was the low six — pure guesswork under pressure.
So the bit grid lives next to the number here. Thirty-two bits, thirty-two cells, lit for 1. Click a cell and that bit flips, value follows.
0x starts hex, 0b binary, 0o octal. Bare digits follow the mode you picked — in HEX mode you can type DEAD straight in.
Precedence matches C: parentheses, multiply/divide, add/subtract, shifts, AND, XOR, OR. NOT is unary, written ~ or NOT. Division floors, because this is integer math, not a bug.
Hit Enter to evaluate. The result drops back into the input, so you can keep going without losing context.
In 8-bit mode, 255 + 1 is 0. Overflow is not an error here — it is what the hardware does when every cell is lit and a carry arrives.
The DEC line shows signed and unsigned when they differ. A grid with all the high bits lit is two's complement — a negative number, easy to spot.
My own habit: 8-bit for flag registers, 32-bit for address math with shifts and OR, 64-bit only when a device ID forces it.
Why is 255 + 1 equal to 0 in 8-bit mode?Every result is truncated to the current width. Eight bits are already all lit at 255, so adding 1 wraps to zero. That is not a bug — it is what real hardware does. Switch to 32 or 64 bits for bigger numbers.
How do I type a hex value?Two ways: switch the input mode to HEX and type the letters A–F directly, or use the 0x prefix in any mode, like 0x1F. Binary takes 0b and octal takes 0o, regardless of the mode.
Does my expression leave the browser?No. The evaluator runs on BigInt inside your page. Nothing is uploaded, and the expression is only saved in this device's localStorage so it survives a refresh. Use the "Clear my data" link in the footer to wipe it.
Does it support decimals or floats?No. This tool handles integers only — floats are a different binary format (IEEE 754) and mixing them in causes silent mistakes. Use a regular calculator for decimals.
Tool: Programmer Calculator: Hex, Bitwise Ops, Bit Grid. You may also like the Cron Expression Translator.
中文版:https://www.9314.cn/tools/prog-calc/
浏览统计(最近30天)
评论列表 (0条)