| Binary | Mode | Bit width | Decimal | Use case |
|---|---|---|---|---|
| 101101 | Unsigned | — | 45 | General conversion |
| 11111111 | Two's complement | 8 | -1 | Signed byte representation |
| 10000000 | Two's complement | 8 | -128 | Smallest 8-bit integer |
| 10.101 | Unsigned | — | 2.625 | Fixed-point style fractions |
| Time | Binary | Mode | Width | Scale | Decimal | Notes |
|---|---|---|---|---|---|---|
| No calculations yet. Convert a value to populate this table. | ||||||
For an unsigned binary number with bits bn-1 … b0, the decimal value is:
If a fractional part exists, .f1 f2 … fm, it adds:
Two’s complement integers use the same weights, but the top bit is negative: V = -bn-1·2n-1 + Σ (bi·2i).
- Enter a binary value (optionally with a decimal point).
- Select Unsigned or Two’s complement interpretation.
- If using two’s complement, choose a bit width (or auto).
- Adjust Fraction display scale for longer decimals.
- Click Convert to decimal to see the result and steps.
- Use Download CSV or Download PDF to export history.
Binary place values and practical ranges
Each left shift doubles value, so bit positions grow quickly. A 10-bit unsigned number spans 0–1023, while 16-bit spans 0–65,535. This calculator displays positional weights as 2^i, helping you verify where magnitude comes from before trusting the final decimal output.
Unsigned conversion with stepwise doubling
The integer engine uses repeated doubling: acc = acc×2 + bit. This is stable for long inputs because it avoids floating arithmetic. For example, 101101 converts as (((((0×2+1)×2+0)×2+1)×2+1)×2+0)×2+1 = 45, matching the weight-sum method.
Fractional bits and fixed decimal precision
Fractional weights are 2^-k, so 0.1₂ = 0.5 and 0.01₂ = 0.25. With scale set to 20 digits, 10.101₂ becomes 2.625 exactly. When fractions repeat in base-10, scale controls display length, and the history table keeps a consistent precision record.
Two’s complement interpretation and bit width
Signed integers depend on width. With 8-bit two’s complement, 11111111₂ is −1 and 10000000₂ is −128. If you choose 16-bit, the same pattern is padded and represents a different magnitude. Width selection prevents accidental misreads when copying values from bytes, words, or registers.
Validation rules that prevent silent mistakes
Inputs accept only 0, 1, and one decimal point; spaces and underscores are ignored. Two’s complement mode blocks fractions to avoid ambiguous signed fixed-point assumptions. A configurable fractional-bit limit keeps results readable, especially when users paste long binary strings from logs or exports.
Exports, reproducibility, and review workflow
CSV export captures timestamp, mode, width, scale, and the computed decimal value for audit trails. PDF export prints your latest result plus the session history table, supporting quick reviews. For best practice, convert, scan the Plotly contribution bars, then export the record you used for decisions.
Does this support very large binary integers?
Yes. Integer conversion uses decimal-string arithmetic, so long unsigned inputs are handled without integer overflow. The Plotly chart may approximate very large contributions because it uses floating values for visualization.
Why does two’s complement require a bit width?
Signed meaning depends on the sign bit’s position. With 8 bits, 10000000₂ equals −128; with 16 bits, 10000000₂ equals 128. Selecting width aligns the calculation with your data source.
How accurate are fractional conversions?
Fractional bits are converted using scaled integer terms based on 10^scale / 2^k. Exact results appear when the decimal terminates; repeating decimals are displayed up to your selected scale.
Can I enter separators like spaces or underscores?
Yes. The input cleaner removes spaces and underscores, so values like 1101_0010 or 1101 0010 are accepted. Characters other than 0, 1, and a single dot are rejected.
What happens if my fractional part is very long?
The calculator enforces a fractional-bit limit you can adjust. If the fraction exceeds the limit, it shows an error instead of producing an unreadably long decimal expansion.
How do the CSV and PDF exports differ?
CSV is best for spreadsheets and automated checks, containing structured columns for each run. PDF is best for sharing and printing, summarizing the latest result plus the on-page history table.