CLEAN removes non-printable characters from text — the kind of invisible junk that often comes in from exported or copy-pasted data.
CLEAN strips out non-printable characters — things like line breaks and control characters that sometimes get pulled in when copying from a website, PDF, or database export.
It does not remove regular spaces; for that, you need TRIM. The two are often used together on messy imported data.
=CLEAN(text)| Argument | Description |
|---|---|
| text required | The text to clean, or a cell reference containing it. |
=CLEAN(A2)Strips out line-break characters that sometimes appear when pasting from a website or PDF.
=TRIM(CLEAN(A2))Removes both non-printable characters and extra spaces in a single formula.
=EXACT(CLEAN(A2),CLEAN(B2))Useful when two values look identical but a hidden character is causing a comparison to fail.
| Function | Removes |
|---|---|
| CLEAN | Non-printable control characters (line breaks, etc.) |
| TRIM | Extra regular spaces (leading, trailing, doubled) |
Messy imported data often needs both: =TRIM(CLEAN(A2)) handles invisible control characters and extra spaces in one formula.
It only removes non-printable control characters — use TRIM for ordinary spaces.
ExcelPro has 700+ hands-on Excel exercises across 7 career tracks — free to start, no download needed.
Start practicing free →