How to Fix Underscores Turning into Spaces in Microsoft Word
Question details
The user is experiencing an issue where typing underscores using the Shift+hyphen shortcut results in blank spaces on specific lines of a Word document.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Editing a formal or legal document where precise punctuation, line formatting, and specific character inputs are strictly required.
- Observed behavior
- Pressing Shift+hyphen produces a blank space instead of an underscore on certain lines, despite the shortcut functioning normally in other parts of the same document.
Ensure you have saved a backup copy of your original document, especially if it is a formal or legal file, before attempting to clear formatting or transfer text to a new file.
Copy Content to a New Blank Document
Resolve document-specific corruption or hidden control characters by migrating your unformatted text to a fresh file.
Often, localized formatting glitches or document corruption can cause standard keyboard inputs to behave unexpectedly. Transferring your text to a new file clears these underlying errors.
Open Microsoft Word and create a completely new, blank document.
Return to your problematic document, press Ctrl+A to select all the text, and press Ctrl+C to copy it to your clipboard.
In the new document, right-click the page and choose 'Keep Text Only' under the Paste Options, or press Ctrl+Shift+V. This pastes the text without bringing over the corrupted formatting.
Try typing Shift+hyphen on the previously affected lines in the new document to ensure the underscore now appears correctly.

Clear Formatting from the Affected Section
Remove hidden styles or accidental control characters that may be overriding the underscore character on specific lines.
Insert the Underscore Manually
Bypass keyboard shortcut glitches by inserting the underscore character directly from the Symbol menu or via an Alt code.
Try WPS Office for Glitch-Free Document Editing
If Microsoft Word continues to struggle with formatting glitches and document corruption, consider switching to WPS Office. It is a highly compatible, lightweight, and free alternative that handles legal and formal documents seamlessly.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install the software: Run the installer and follow the simple on-screen instructions to set up WPS Office on your device.
- 3. Open your Word documents: Launch WPS Writer and open your existing .docx files directly. Your formatting and content will remain perfectly intact, and keyboard shortcuts will work as intended.

Frequently Asked Questions
Why does Microsoft Word suddenly change my underscores to spaces?
This usually happens due to localized document corruption, hidden control characters, or conflicting text formatting styles applied to specific lines in your document. Transferring the text to a new file usually resolves it.
What is the Alt code for an underscore?
The Alt code for an underscore is Alt+95. To use it, make sure your Num Lock is on, hold down the Alt key, type 95 on your numeric keypad, and release the Alt key.
Can AutoFormat or AutoCorrect cause underscores to disappear?
Yes, in some instances, Word's AutoFormat feature might interpret repeated underscores as a command to create a border, or it might replace them incorrectly based on custom AutoCorrect rules. You can check these settings under File > Options > Proofing > AutoCorrect Options.




