BitForge

Understand bits. Control every bit.

Profile

Forge your bits.

Explore fixed-width integers, manipulate individual bits, and inspect how values are stored in memory.

01 / Value setup

Unsigned integer

02 / Bit-level view

Click a bit to toggle
Bit index: 0 = least significant bit (LSB). Bytes stay grouped. 32-bit values display as two rows of 16 bits; 64-bit values display as four rows of 16 bits. Scroll horizontally on narrow screens.

Bit transition

Before → after
Perform a bit operation to compare the previous and resulting values.
Before and after bits are aligned in the same byte rows. Changed bits are highlighted; 32-bit values use two rows and 64-bit values use four rows.

03 / Number representations

Live value
Binary
—
Decimal
—
Hexadecimal
—

04 / Bit operations

Apply to current value

Set bit positions

Reset bit positions

Toggle bit positions

Check bit

Extract bit positions

Shift value

Insert bit field

Count / mask

Operation output will appear here.

05 / C code generator

Embedded C · fixed-width

Generate copy-ready C expressions for the selected datatype. The target register/variable must already be declared.

Uses stdint.h / stdbool.h and UINT64_C for safe constants. Review hardware register access rules for your MCU.

06 / Memory view

Byte order
2 bytes
Endianness changes the order of bytes in memory, not the integer's bit-operation result.

07 / Quick checks

Useful bit facts

08 / Safe condition

No code execution
Choose a comparison value.

09 / SECDED lab

Python backend
Encoded codeword will appear here.
Decoder output will appear here.
SECDED corrects a single-bit error and detects a double-bit error. The overall parity bit is the rightmost bit.

10 / Test status

Core logic
Python core: 15 / 15 tests passed
Single-bit correction · Double-bit detection
The HTML playground performs these interactive operations in your browser. SECDED encoding/decoding remains in the tested Python core for the next integration step.