How to Reverse a Binary Bit String in Excel
Question details
The user needs to reverse the order of bits in a binary string from least significant to most significant and preserve leading zeroes when required.

- Product
- WPS Office Spreadsheets
- Device & OS
- not provided
- Scenario
- The user has a binary bit string in a worksheet cell and needs the reversed bit order for bit-level calculations, formatting, or data transformation.
- Observed behavior
- The bit string is in its original order; leading zeroes may be dropped if the cell is treated as a number, and the user needs a formula-based reversal with optional fixed 32-bit padding.
Make sure the bit string is stored as text or the cell is formatted as Text. This prevents the spreadsheet from automatically removing leading zeroes before the reversal formula runs.
Reverse a Variable-Length Bit String with LET, SEQUENCE, MID, and CONCAT
Use this formula when the bit string length can vary and you need a compact formula that preserves the original leading zeros in a text-formatted cell.
This formula creates a descending sequence of character positions from the last character to the first, extracts each character with MID, and joins them back with CONCAT. It works for any bit string length and does not require a fixed 32-bit input.
Click the cell where you want the reversed bit string to appear, such as E2.
Type =LET(bits,D2,CONCAT(MID(bits,SEQUENCE(LEN(bits),,LEN(bits),-1),1))) and press Enter. Replace D2 with the cell that contains your original bit string.
If the original cell is text-formatted, the result keeps leading zeroes. If leading zeros disappear, format the source cell as Text and re-enter the bit string.

Reverse a Fixed 32-Bit Binary String with Padding
Use this approach when you need a fixed 32-bit output or want to convert a decimal number to a 32-bit binary string, keep leading zeros, and then reverse the bit order.
Reverse Binary Bit Strings in WPS Office Spreadsheets
WPS Office Spreadsheets supports the same dynamic array functions used in Excel, so you can reverse a binary bit string, preserve leading zeroes, and apply fixed 32-bit padding without switching to another tool.
- 1. Open your workbook: Launch WPS Office Spreadsheets and open the workbook that contains the bit string.
- 2. Format the input cell as Text: Select the source cell, press Ctrl+1, choose Text, and click OK so leading zeroes remain intact.
- 3. Enter the reversal formula: In the output cell, type =LET(bits,D2,CONCAT(MID(bits,SEQUENCE(LEN(bits),,LEN(bits),-1),1))) and press Enter.
- 4. Apply 32-bit padding if needed: For a fixed 32-bit result, use =RIGHT(REPT("0",32)&DEC2BIN(A2),32) in a helper cell, then apply the fixed reversal formula.
- 5. Save in Excel-compatible format: Click Menu > Save As and keep the .xlsx format to share the file smoothly with Microsoft Excel users.

Frequently Asked Questions
Why does my reversed binary string lose leading zeroes?
Spreadsheets treat unformatted numeric entries as numbers and remove leading zeroes. Format the input cell as Text before entering the bit string, or use =RIGHT(REPT("0",32)&DEC2BIN(A2),32) to pad the binary string.
Can I reverse a binary bit string without using LET?
Yes. Use =CONCAT(MID(D2,SEQUENCE(LEN(D2),,LEN(D2),-1),1)) for a variable-length string, or =CONCAT(MID(D2,SEQUENCE(32,,32,-1),1)) for a fixed 32-bit string.
Does this formula work in both WPS Office and Microsoft Excel?
Yes. Current versions of WPS Office Spreadsheets support LET, SEQUENCE, MID, and CONCAT, and the formula syntax is compatible with Excel workbooks.
How do I create a 32-bit binary string with leading zeroes?
Use =RIGHT(REPT("0",32)&DEC2BIN(A2),32), where A2 is the decimal number. This returns a text string padded to 32 bits that you can then reverse.
What should I do if the bit string length is not always 32 bits?
Use the variable-length formula =LET(bits,D2,CONCAT(MID(bits,SEQUENCE(LEN(bits),,LEN(bits),-1),1))). It automatically adapts to the length of the text in D2.




