Set your destination cells to Text before scanning digits-only barcodes in Socket Mobile’s Basic (HID) mode. Excel then stores an inventory ID such as 00123 as text with both leading zeros intact. Microsoft Text format · Socket Mobile keyboard mode
Why Excel drops leading zeros
Socket Mobile’s Basic (HID) mode sends scan data to Excel like typed input. If Excel converts an all-digit ID to a number, it drops the leading zeros, so 00123 becomes 123. Socket Mobile Basic Mode · Microsoft leading-zero guidance
Format the cells as Text before scanning
- Select the empty cells where the scans will go. Microsoft Text format
- In desktop Excel, open the Home tab. In the Number group, select the arrow next to the Number Format box and choose Text. In Excel for the web, right-click the selected cells, choose Format Cells, then select Text under Choose Category. Desktop steps · Web steps
- Scan a barcode into a cell formatted as Text. In desktop Excel, check the value in the formula bar. Socket Mobile keyboard mode · Microsoft formula bar guidance
Check whether Excel stored the zeros
In desktop Excel, use the formula bar to check the actual value. Here’s how three formats display the example inventory ID 00123 and what appears in the formula bar. Microsoft Text format · Microsoft five-digit format · Microsoft formula bar guidance
| Cell format | What the cell displays | Stored value shown in the formula bar |
|---|---|---|
| Text applied before entry | 00123 | 00123 (text) |
| General, with default numeric conversion | 123 | 123 (number) |
Custom 00000 set before entering the code | 00123 | 123 (number) |
Recover IDs from earlier scans
Applying Text to cells after scanning leaves previously entered numbers unchanged. If you have the original IDs, rescan or re-enter them into a fresh range formatted as Text. Microsoft leading-zero guidance · Microsoft Text format · Socket Mobile keyboard mode
If the IDs are known to be exactly five digits and only leading zeros were lost, a formula can rebuild them as text. In an empty column next to your data, enter =TEXT(A1,"00000") for the code in A1. Microsoft TEXT example
Evidence and limits. Microsoft Support instructions for Excel for Microsoft 365, Excel 2024, Excel 2021 and Excel for the web, plus Socket Mobile’s keyboard-mode documentation, were checked on 2026-11-27. This guide is not based on hands-on testing. For a text or CSV export, follow Microsoft’s text-file import guide. The SocketScan 700 Series guide covers pairing and mode settings. Desktop Excel · Excel for the web · Keyboard mode · Text-file import · SocketScan 700 Series guide