How to Remove Extra Trailing Spaces When Copying Excel Cell Text
Question details
The user needs to eliminate hidden trailing spaces that appear when copying text from an Excel cell and pasting it into another application.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Copying cell data from Excel and pasting it into Word, mail merges, or other external applications.
- Observed behavior
- An unwanted trailing space is appended to the pasted text, even though the space is not visible in the original Excel cell.
Double-click the source Excel cell to verify whether the extra space physically exists at the end of your text or if it is being generated during the copy-paste process.
Use TRIM or CLEAN Functions to Remove Unwanted Spaces
The most reliable way to strip hidden trailing spaces and non-printable characters before copying the text.
Often, imported data contains hidden spaces or non-printing formatting characters. Utilizing Excel's built-in text formulas ensures the raw data is entirely clean before you export it.
Click on an empty cell adjacent to the text you want to copy.
Type =TRIM(A1) (replacing A1 with the cell containing your text) and press Enter. This removes any extra spaces at the beginning and end of the text.
If you suspect non-printable characters are causing the issue, use =CLEAN(A1) or combine them as =TRIM(CLEAN(A1)).
Select the new cell containing the formula result, press Ctrl+C, and paste it into your desired application.

Change Paste Options in the Destination Application
Modify how the text is pasted into applications like Word to strip out cell formatting and hidden boundaries.
Open Excel in Safe Mode to Disable Conflicting Add-ins
If the trailing space issue persists unexpectedly across all workbooks, a third-party add-in might be modifying your clipboard data.
Use WPS Spreadsheet for Clean Text Management
WPS Office Spreadsheet provides excellent text formatting control, ensuring clean copy-pasting to documents without phantom spaces. It seamlessly handles data cleansing functions.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your .xlsx or .xls document.
- 2. Use the TRIM formula: In an adjacent cell, type =TRIM(cell_reference) to instantly clear any trailing spaces.
- 3. Copy the formatted text: Press Ctrl+C to copy the cleaned cell data.
- 4. Paste without formatting: Right-click your target destination and choose 'Keep Text Only' to prevent any cell boundary from converting into a space.

Frequently Asked Questions
Why does Excel add a space when I copy and paste a cell?
When you copy an entire cell in Excel, it copies the formatting and cell boundaries along with the text. In some destination applications, this hidden cell boundary is interpreted as a space or a tab. Copying just the text from the formula bar or pasting as 'Unformatted Text' prevents this.
What is the difference between TRIM and CLEAN functions?
The TRIM function is designed to remove extra spaces from text, leaving only single spaces between words and removing any leading or trailing spaces. The CLEAN function removes non-printable characters (like line breaks or hidden system characters) that often come with imported data.
How can I make 'Paste as Text Only' the default in Word?
In Microsoft Word, navigate to File > Options > Advanced. Scroll down to the 'Cut, copy, and paste' section. You can change the default paste setting for 'Pasting from other programs' to 'Keep Text Only'. Click OK to save the changes.




