Bitwise flag decoder

Enter a non-negative whole number. Use 0x for hex, 0b for binary or 0o for octal. Tick flags below to build a value.

Decoded result

Decimal
Hex
Binary

Enabled bits

    Flag names

    Load replaces the current names and width, keeping your input value. Download your configuration before loading another if you want to keep your names.

    Paste names from a spreadsheet

    Copy cells without column headers. Paste one name per row, or two columns containing bit numbers and names. You can also paste a column into a name cell below to open this preview.

    
    
    

    Select enabled bits and edit their optional names.
    EnabledBitDecimal valueHex valueFlag name

    How to use this tool

    Enter a bitmask to see which bits are enabled. Decimal, hexadecimal, binary and octal inputs are accepted. The default width is 64 bits, numbered 0–63. Choose another width for your data.

    Enter names in the table to label the result. Use the checkboxes to build a mask, or filter the table to enabled bits. Unnamed enabled bits still appear in the result.

    To paste names, copy a column from your spreadsheet and open “Paste names from a spreadsheet”. Choose the starting bit, check the preview, then select Apply names. For sparse definitions, copy two columns containing bit numbers and names and choose “Bit number + name”. Blank names clear labels; other labels stay as they are.

    Download configuration saves your names, width and optional configuration name as JSON. Use Load configuration to restore them later or on another device. The decoded value is excluded from the file.

    Example

    A value of 11 (0b1011) enables bits 0, 1 and 3, with values 1, 2 and 8. If you name those bits Read, Write and Admin, those labels appear in the result.

    When to use it

    Inspect permissions from an API, decode status flags in a log, or build a mask from individual options. Flag names depend on the system that produced the value; the tool cannot infer them.

    Privacy and data handling

    Values, flag names, pasted rows, configuration files and results are processed in your browser. The tool does not upload them, save them in browser storage or include them in URLs. Download saves a JSON file to your device; loading reads the file you select.

    Copy result writes to your clipboard only when you select it. Spreadsheet paste uses your normal paste action. The site stores your theme preference and uses Cloudflare Web Analytics for page visits and loading performance. Tool data is excluded. See the privacy page.

    Formats and limits

    Widths of 8, 16, 32, 64 and 128 bits are supported. Arithmetic preserves exact integer values across that range. Negative values, fractions, composite flag definitions and signed interpretations are unsupported. Values beyond the selected width produce an error; bits are never silently discarded.

    Flag names can contain up to 200 characters, including Unicode. Configuration names can contain up to 100 characters. Configuration files are limited to 256 KiB. Pasted rows are limited to 65,536 characters and one row per available bit. Spreadsheet rows use tabs between columns; quoted cells and embedded line breaks are supported. Omit headers.

    Configuration files use version 1, with name, bitWidth and a flags array of bit/name pairs. Bits must be unique and within the saved width. A malformed file leaves the current configuration intact. Loading a narrower configuration keeps your input and reports an error if it exceeds that width.

    To reduce the width with the selector, first clear any names outside the new range. Reloading or closing the page clears tool data. Download a configuration before leaving if you want to reuse your names. A browser with support for large integers is required; clipboard access may require permission.