How to remove special characters from text in Google Sheets
Google Sheets formula
=TRIM(REGEXREPLACE(A2,"[^A-Za-z0-9 ]",""))Keep only letters, digits and spaces, then tidy the spaces: =TRIM(REGEXREPLACE(A2,"[^A-Za-z0-9 ]","")).
- Result on the example
- one result per row in
B2, filled down toB6 - Excel
- See below
See it work
The formula is already in B2, filled down to B6. Change any input and the result updates, or edit the formula to experiment.
How it works
A ^ inside square brackets means "not": [^A-Za-z0-9 ] matches any character that isn't a plain letter, a digit or a space, and REGEXREPLACE deletes every one. Removing the dash in "Chair – Mesh" leaves two spaces in a row, so TRIM collapses them to one.
=TRIM(REGEXREPLACE(A2,"[^A-Za-z0-9 ]",""))Result"Desk Lamp LED"
A2"Desk Lamp™ (LED)!"The value in A2.
REGEXREPLACE(A2,"[^A-Za-z0-9 ]","")"Desk Lamp LED"REGEXREPLACE: Replaces every match. Use $1 for a captured group.- text
A2"Desk Lamp™ (LED)!" - regular_expression
"[^A-Za-z0-9 ]" - replacement
""
- text
TRIM(REGEXREPLACE(A2,"[^A-Za-z0-9 ]",""))"Desk Lamp LED"TRIM: Removes extra spaces, leaving single spaces between words.- text
REGEXREPLACE(A2,"[^A-Za-z0-9 ]","")"Desk Lamp LED"
- text
In Excel
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =REGEXREPLACE(A2,"[^A-Za-z0-9 ]","") | Desk Lamp LED, Office Chair Mesh, Monitor Arm 2…Different result | Without TRIM, gaps are left where symbols sat between spaces. Double spaces in "Office Chair Mesh" and "Mouse Keyboard Set". |
| =TRIM(REGEXREPLACE(A2,"[^A-Za-z0-9 .\-]","")) | Desk Lamp LED, Office Chair Mesh, Monitor Arm 2… | Add characters to the list to keep them, here dots and hyphens. None of these names have any, so the result is the same. |
Common mistakes
A-Za-zcovers only unaccented letters, so "Café" loses its é. Use\p{L}for letters in any language:"[^\p{L}0-9 ]".- A hyphen inside square brackets means a range unless it is escaped or placed last.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Remove special characters from text
B2, remove every character from A2 that isn't a letter, a digit or a space, with no double spaces left behind. Fill down to B6.Questions
How do I remove one specific character?
Use SUBSTITUTE for a fixed character: =SUBSTITUTE(A2,"#","").
How do I remove emojis?
The same pattern removes them, since they aren't letters or digits.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine.