conversion_binary_decimal
Convert a single number between binary (base 2) and decimal (base 10) in either direction. Supports signed or unsigned interpretation, 8/16/32/64-bit width, and optional fractional parts.
Instructions
Binary And Decimal Number Converter. Convert a single number between binary (base 2) and decimal (base 10) in either direction, with unsigned or signed (two's-complement) interpretation across an 8/16/32/64-bit width and optional fractional (radix-point) support. Use this when you need bit-level detail for one number — a positional bit breakdown and two's-complement handling at a fixed width. Use conversion_base_converter instead to convert one integer between arbitrary radixes 2-36, conversion_number_base to map a string of byte values across ASCII/binary/hex/decimal/octal, and conversion_decimal_hex for decimal-hex conversions. Runs locally via the shared logic runner: read-only, non-destructive, offline, no auth, default rate limit. Returns the converted string plus the echoed settings and, for binary-to-decimal, a per-bit breakdown.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | Conversion direction. | |
| input | Yes | The number to convert. For binary-to-decimal, digits 0/1 with an optional fractional part (e.g. "1010" or "101.1"). For decimal-to-binary, a decimal value with optional sign/decimal point (e.g. "-42" or "5.25"). Leading/trailing whitespace is trimmed. | |
| numberType | No | Interpretation of the value. 'signed' enables two's-complement at the given bitWidth; 'unsigned' treats it as non-negative. | unsigned |
| bitWidth | No | Fixed width for signed (two's-complement) interpretation. Required to be one of the enum values when numberType is 'signed'; ignored for unsigned. | |
| allowFractional | No | When true, permits a fractional (radix-point) part; when false, a fractional input is rejected with an error. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | True when conversion succeeded; false on validation error. | |
| result | No | The conversion result (present when success is true). | |
| error | No | Error message (present when success is false). |