SPI Data Frame Converter
Convert a hexadecimal SPI data word into its transmitted binary sequence. Choose the SPI word width and whether data is shifted most-significant bit first or least-significant bit first.
What Is an SPI Data Frame?
SPI, or Serial Peripheral Interface, is a synchronous serial communication method in which data bits are shifted between devices under control of a clock signal.
Unlike UART, SPI does not normally add a start bit, parity bit or stop bit to every data word. The transmitted data sequence is primarily determined by the data value, word width and selected bit order.
How This SPI Data Frame Converter Works
Enter a hexadecimal value, choose the number of bits in the SPI word and select whether the most-significant bit or least-significant bit is shifted first.
The calculator pads the data to the selected width and then generates the exact bit sequence in transmission order.
8-bit binary: 10100101
MSB-first sequence: 10100101
SPI MSB-First Transmission
In MSB-first mode, the highest-order bit is shifted first, followed by each progressively lower bit.
Binary: 10100101
Transmission: 1 → 0 → 1 → 0 → 0 → 1 → 0 → 1
For MSB-first transmission, the normal left-to-right binary representation already matches the bit transmission order.
SPI LSB-First Transmission
In LSB-first mode, bit 0 is shifted first and the most-significant bit is transmitted last.
Normal binary: 10010110
LSB-first transmission: 01101001
The underlying numeric value remains 0x96. Only the order in which its individual bits appear on the serial line changes.
SPI Word Width
SPI hardware can be configured for different data-word sizes. This calculator supports common 8-, 16-, 24- and 32-bit words.
| Word Width | Hex Digits | Clocked Data Bits |
|---|---|---|
| 8 bits | 2 | 8 |
| 16 bits | 4 | 16 |
| 24 bits | 6 | 24 |
| 32 bits | 8 | 32 |
16-Bit SPI Example
Suppose the data word is 0x1234 with a width of 16 bits.
Binary: 0001001000110100
In MSB-first mode the first transmitted bit is bit 15. In LSB-first mode bit 0 is sent first.
SPI Data and Clock Pulses
Each data bit normally requires one SPI clock cycle. An eight-bit data word therefore requires eight clock periods, while a sixteen-bit word requires sixteen.
16-bit word: 16 data clocks
32-bit word: 32 data clocks
This calculator reports the number of clocked data bits but does not calculate the actual elapsed transfer time.
SPI MOSI and MISO
SPI commonly provides separate data lines for controller-to-peripheral and peripheral-to-controller communication. These are traditionally called MOSI and MISO.
The same bit-order concept applies to either data direction: a configured device may shift a data word MSB first or LSB first.
This calculator represents one data word only and does not simulate simultaneous bidirectional traffic.
SPI vs UART Framing
| Feature | SPI | UART |
|---|---|---|
| Shared Clock | Yes | No |
| Start Bit | Normally no | Yes |
| Parity | Not inherent | Optional |
| Stop Bits | Normally no | Yes |
| Bit Order | Often configurable | Commonly LSB first |
That is why this page does not reuse the UART frame calculation formula.
SPI Byte Grouping
For wider words, the calculator also displays the normal hexadecimal byte groups. This can make it easier to compare a multi-byte SPI value with register maps or logic-analyzer output.
Bytes: A1 B2 C3 D4
The selected bit order determines the bit sequence of the entire configured word in this calculator.
Important SPI Data Frame Notes
The input value must fit inside the selected 8-, 16-, 24- or 32-bit width.
MSB-first sends the highest-order bit first.
LSB-first sends bit 0 first.
The calculator reverses the complete selected data word for LSB-first display.
SPI itself does not universally define one required word width or bit order.
This tool does not calculate CPOL, CPHA, setup time, hold time, chip-select timing or SPI transfer duration.
Always confirm the actual SPI configuration required by the peripheral datasheet.