conversion_bcd
Convert decimal numbers to 8421 Binary-Coded Decimal (BCD) or decode BCD nibbles back to decimal. Each decimal digit is encoded as a 4-bit group.
Instructions
BCD Converter (Binary-Coded Decimal). Convert a decimal number to 8421 Binary-Coded Decimal (BCD), or decode BCD nibbles back to a decimal number. In BCD each decimal digit 0-9 is encoded independently as its own 4-bit group, so 25 becomes 0010 0101 rather than the pure-binary 11001. Only the standard 8421 weighting is supported (no excess-3 or 2421 variants). Use conversion_binary_decimal for whole-number pure base-2/decimal conversion, conversion_gray_code for reflected binary, or conversion_parity_bit for error-detection bits. Runs locally on the value you provide: read-only, non-destructive, offline, and rate-limited (60 requests/min anonymous). Returns the converted string, the echoed input/mode/formats, and a per-digit breakdown.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Value to convert. For decimal-to-bcd, decimal digits 0-9 only, maximum 16 digits. For bcd-to-decimal, BCD interpreted per inputFormat (maximum 16 nibbles); each nibble must decode to 0-9. | |
| mode | Yes | Conversion direction. decimal-to-bcd encodes a decimal number as BCD; bcd-to-decimal decodes BCD nibbles back to a decimal number. | |
| outputFormat | No | BCD rendering for decimal-to-bcd output. nibbles is space-separated 4-bit groups, continuous is one unbroken bit string, hex is a 0x prefixed hexadecimal string. Ignored for bcd-to-decimal. | nibbles |
| inputFormat | No | How input is parsed for bcd-to-decimal. nibbles is space-separated 4-bit groups, continuous is a bit string whose length is a multiple of 4, hex is a 0x prefixed hexadecimal string. Ignored for decimal-to-bcd. | nibbles |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | Whether the conversion succeeded. | |
| input | No | The input value, echoed back. | |
| mode | No | The conversion mode used: decimal-to-bcd or bcd-to-decimal. | |
| outputFormat | No | The output format applied: nibbles, continuous, or hex. | |
| inputFormat | No | The input format applied: nibbles, continuous, or hex. | |
| result | No | The converted string (BCD groups or decimal number, per mode). | |
| breakdown | No | Per-digit mapping between each decimal digit and its 4-bit BCD group. |