CLEAN Function
Removes non-printing characters such as line breaks from text.
Category
Text
Available in
All versions, Microsoft 365
Returns
Text
Overview
CLEAN strips out the invisible control characters (codes 0–31) that sneak in from other systems — line breaks, tabs and odd symbols.
Pair it with TRIM to clean imported text in one step.
Syntax
=CLEAN(text) Explain
Arguments
| Argument | Required? | What it does |
|---|---|---|
| text | Yes | The text or cell to clean. |
Examples
Example 1 — Removing line breaks
Addresses exported with line breaks inside a single cell show up on several lines.
=CLEAN(A2) Explain
The line breaks disappear — but so do the gaps they made, so words can run together.
Example 2 — Swap line breaks for commas instead
Keep the parts separated.
=SUBSTITUTE(A2, CHAR(10), ", ") Explain
Common mistakes
- Character 160 and others. CLEAN only removes codes 0–31. Non-breaking spaces (160) and some Unicode characters need SUBSTITUTE.
Notes
- Related functions: TRIM, SUBSTITUTE, CHAR, CODE.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.