Bit Flag & Permission Visualizer

Decode a bitmask into named flags, toggle individual bits and read Unix permissions, hex, octal and binary at a glance.

Reading 755 as octal = 493 decimal

Flags S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH

Hex
0x000001ED
Decimal
493
Octal
0o755
Signed
493
Full breakdown
Bits set
7 of 32
Symbolic
rwxr-xr-x (chmod 0755)
Binary
0000 0000 0000 0000 0000 0001 1110 1101

7 of 12 flags set

    Flag definitions

    One NAME = value per line. Values can be decimal, 0x hex, 0b binary, 0o or leading-zero octal, a shift such as 1 << 3, or an OR of names already defined above. # starts a comment.

    No uploads. Your files stay on your device.

    Free forever, no sign-up, no cookies. Buy me a coffee

    How it works

    Type a bitmask in hex, decimal, octal or binary and the tool decomposes it: every bit is drawn as a toggle, every named flag that is present is ticked, and the whole thing is restated as an OR expression such as O_WRONLY | O_CREAT | O_TRUNC. Click a bit or tick a flag and the value updates the other way round, so you can build a mask by hand instead of doing the arithmetic. Widths of 8, 16, 32 and 64 bits are supported with exact BigInt maths, and the signed two's-complement reading is shown next to the unsigned one.

    Two real flag sets ship with the page. Unix file mode uses the POSIX constants from IEEE Std 1003.1 (S_ISUID 0o4000, S_IRUSR 0o400 and the rest) and adds the ls-style symbolic reading, so 0o755 shows as rwxr-xr-x and 0o4755 as rwsr-xr-x, with the setuid bit folded into the owner execute column. Linux open(2) flags uses the values from asm-generic/fcntl.h, which cover x86-64 and arm64; alpha, mips, parisc and sparc define different numbers, so check your platform header before trusting a decode there. Anything else you define yourself in the flag definitions box.

    Everything runs in your browser. No value, mask or flag list is uploaded anywhere, and the page makes no network requests at all.

    Frequently asked questions

    How do I tell which flags are set in a bitmask?

    A flag is set when the mask ANDed with the flag value equals the flag value. Paste your number, pick a flag set (or paste your own NAME = value list) and the tool ticks every flag that is present and restates the mask as an OR expression such as O_WRONLY | O_CREAT | O_TRUNC. Bits that no flag covers are reported separately so nothing is silently ignored.

    Does it decode Unix file permissions like 755?

    Yes. The default flag set is the POSIX file mode bits from IEEE Std 1003.1, so 0o755 decodes to S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH and shows the ls-style string rwxr-xr-x. The setuid, setgid and sticky bits are handled properly too: 0o4755 reads rwsr-xr-x, and an uppercase S or T means the special bit is set while the matching execute bit is not.

    Can it handle 64-bit masks and signed values?

    Yes. Widths of 8, 16, 32 and 64 bits are supported and all arithmetic uses JavaScript BigInt, so there is no floating-point rounding at the top end. The unsigned decimal value and the two's-complement signed reading are shown side by side, so 0xFFFFFFFFFFFFFFFF at 64 bits shows both 18446744073709551615 and -1.

    Report a bug