How to remove non-breaking spaces on Mac
You can do this with Note My. Here is how to see a space that is not a space, read its code point, and convert every instance in a document in a single undoable pass.
A compiler reports an unexpected character. A search for id = 5 finds nothing, though the line is plainly there. A YAML file refuses to parse on a line that looks perfect. The culprit is usually the same: a space that is not a space, arrived from a web page, a word processor, a PDF or an AI reply, rendering identically to the character you expected while being a different code point.
This guide covers the four space categories Note My can clean, how to see them on screen, how to confirm which one you have, and how to convert every instance in a document at once. All of it happens on your Mac.
Four kinds of space that are not a space
Our hidden-character scanner covers a long list of stray characters. Four of them are the space family, and all four are safe to replace anywhere: none is ever a deliberate choice.
| Category, as the app names it | Code points | Default action |
|---|---|---|
| Non-breaking space | U+00A0 | Replaced with a space |
| Narrow no-break space | U+202F | Replaced with a space |
| Unusual Unicode spaces | U+2000–U+200A, U+205F | Replaced with a space |
| Ideographic space | U+3000 | Replaced with a space |
The fix below covers all four at once, so which one you have matters mainly when you write a rule by hand. The narrow no-break space is a typesetter's character and arrives with text copied out of typeset documents. The ideographic space is the full-width space of CJK input methods.
All of this happens on your Mac. Nothing is uploaded, there is no account to make, and a document you scan or clean never leaves the machine.
Make the character visible
Two separate things on screen will show you a non-breaking space, and they are worth telling apart.
The first is the invisibles display. Turn on the toolbar's Show Invisibles toggle — its tooltip reads "Show spaces, tabs and line endings" — or use View ▸ Show Whitespace. An ordinary space draws as a middle dot, a tab as an arrow, and a non-breaking space as a ring. That one difference in glyph is usually the whole diagnosis. Four independent switches live in Settings ▸ Invisibles, all off by default.
The second is the set of markers our hidden-character scanner puts on screen, which show you a stray character where it actually sits rather than as an entry in a list somewhere else. They sit over the text without getting in your way: you can still click and type straight through them. The space family gets a background tint rather than a placeholder glyph, so a non-breaking space shows as a tinted cell mid-line without shifting the line's spacing. A revealed finding pulses briefly, then settles so it stays findable; with Reduce Motion on, the pulse is skipped.
Reading the actual bytes behind the character
When you need proof rather than an impression, change the marker style in Settings ▸ Invisibles. There are three:
- Symbols — the default. Quiet placeholders: the dot, the arrow, the ring, and
LF,CRLForCRlabels at the end of lines. - Code Points — the character's Unicode value instead of a placeholder. Encoding-independent, so it tells you what the character is.
- Bytes — hex bytes in the document's own encoding, so it tells you what the file actually saves. A space in a UTF-8 file is
20, the same space in UTF-16 LE is20 00, and a non-breaking space in UTF-8 isC2 A0.
Seeing C2 A0 where you expected 20 ends the argument.
Turn them all into ordinary spaces
-
Open the review sheet
Choose Clean ▸ Clean Invisible / Special Characters… from the toolbar's Clean menu. The sheet sets out every finding in the document beside the categories they belong to, and the ticks in that category list decide what the pass will touch — so you see a whole document's worth of strays, and know exactly what is about to happen to them, before a single character changes.
-
Set the scope and the preset, then scan
The header has a Selection | Whole Document scope control and a preset pop-up offering the four presets plus Custom. The default preset, Code-safe, already enables all four space categories, so you normally change nothing. Press Scan.
Code-safe enables 16 categories in all, so a later Apply will also act on the other enabled ones — trailing whitespace and lone CRs among them. If you want the spaces and nothing else, untick the rest in the left-hand table. Toggling any checkbox switches the preset pop-up to Custom.
-
Read the findings
The left table lists the 21 categories with a checkbox, a severity chip and a found count. The right table lists the findings themselves: Line:Col · Code Point · Category · Action · Risk. Double-click a row to reveal that character in the editor, or select rows and press Show in Editor.
-
Apply
Press Apply (N). Every finding in a ticked category is fixed together, and the whole pass counts as a single undo step named "Clean Invisible Characters", so one ⌘Z puts the document back exactly as it was. The counts you are left looking at describe the document as it stands, so a category showing zero is genuinely dealt with and you can close the sheet knowing where you are.
Then re-run whatever failed. If the search still finds nothing, reopen the sheet and read the character's code point.
The one-click route
If the status bar shows a hidden-character pill — "N hidden" in orange, or "N hidden · D risky" in red — you can skip the sheet. Click it, and the popover offers Show in Text, Remove Invisible Character(s), Review All… and Go to Next. One-click fixing is offered only for the characters that are never wanted, which is why the popover never proposes to touch a curly apostrophe.
The pill is the fast lane. It reports the characters nobody argues about, which is exactly what makes a one-click fix safe to offer, and the review sheet is a click away whenever you want the complete picture: the full category list, every finding with its line, column and code point, and the ticks that settle what the pass will change. Treat the pill as the prompt and the sheet as the reading.
How large a document the pill watches is yours to set: raise the Scan documents up to slider in Settings ▸ Text Cleanup and it keeps reporting on progressively bigger files, or lower it and it stays out of the way on the long ones. The review sheet works at any length at all: our large-file engine takes the whole document however long it is, without making you split the file first, so on a very large file the sheet is the answer.
Two more space rules you can switch on
A second, entirely separate tool sits behind the same Clean menu: our cleanup rules, a list of substitutions you can edit yourself. Open it with Clean ▸ Edit Removal Rules…; the window is titled Residual Removal Rules. Reach for it when you want the same substitution in every document.
It ships with 11 built-in rules. One of them is NBSP→Space, and it is enabled. Three built-ins ship disabled by default, and two of those are space rules: Narrow no-break space→Space and Figure space→Space. If your text comes from typeset or tabular sources, tick both. Leave them off if you are setting typeset copy, where those spaces are doing a job. The built-ins stay as they shipped, so a rule you have come to rely on behaves the same way every time: switch one off when a document does not want it, or duplicate it and work from the copy.
You write a rule as a regular expression with a replacement template, so a code-point escape such as \x{00A0} is a pattern you can write straight into a rule of your own — the way to aim at one exact character and leave everything near it alone. An invalid pattern turns its cell red with the error as a tooltip and is skipped, so a typo costs you that one rule rather than the whole run. The Analyze panel reports per-rule match counts and estimated replacements before you run anything.
Read the Analyze panel, then run the enabled rules over the whole document with Clean ▸ Clean Now. The run counts as a single undo step named "Clean Residuals", so one ⌘Z puts the document back exactly as it was and you can try a rule set out on real text without committing to it. Rule sets export and import as JSON, which is how a set you have tuned reaches your other Mac or a colleague.
Why a space inside a string is still replaced
Protect authored text in Settings ▸ Text Cleanup — the same switch, worded as Protect Strings & Comments, appears in the pill's popover — is on by default. It keeps cleanup away from the parts of a file you wrote on purpose: the text inside strings and comments, where a curly quote or an em dash may well be exactly what you meant. Our advanced language identifier keeps that protection aimed at the right parts of the file.
The protection covers smart quotes, dashes and ellipses — the characters where your intent is the thing that matters. The space family sits outside it by design. A non-breaking space inside a string literal is still offered for replacement, and that is the right outcome: it is not a stylistic choice, it is a character that will fail a comparison.
Code-safe is the preset to stay on while you do this, and it is already the default. It covers all four space categories and treats the rest of the file conservatively, which is what you want in source code, YAML, JSON and anything a machine has to read back. The Aggressive preset is there for the documents where flattening smart punctuation as well is exactly what you are after.
Taking it beyond one document
One clean file is rarely the whole job. The same work scales to the rest of a project without leaving the app, and without any of it leaving your Mac.
Every open document at once. Our find and replace carries a Replace in All Files button that applies the same replacement to every document you have open. Open the files you want changed, put the character itself in the search field, and one press covers the lot. It is the quickest route through a folder of exports that all came out of the same word processor with the same stray space in them.
Seeing which files still have one. Search ▸ Find in Folder… (⇧⌘F) searches a whole directory tree and reports back what it found, so you can tell at a glance which files still carry a stray space before you open any of them. Your files on disk stay exactly as they are until you open one and act — the search reads, and nothing more.
Stepping through them by hand. When you would rather look at each character in context, the Clean menu carries Find Next Hidden Character and Find Previous Hidden Character, and the pill's popover carries Go to Next. Each one takes you to the next stray character in the document, where the marker is already sitting over it, so you can judge it against the line it is on and fix it where it stands.
The same rules everywhere. Once you have a rule set that suits the sources your text keeps arriving from — a typesetting system, a spreadsheet, a CJK input method, an AI reply — export it as JSON and import it on your other Mac. The rules travel; the documents do not.
Troubleshooting
Show Invisibles is on but I see no ring
The ring is drawn by the whitespace switch, one of four independent switches on the Invisibles pane, and each quick route turns on its own combination of them. Open Settings ▸ Invisibles, where what you tick is exactly what you get, and turn the whitespace switch on — it is the one that draws the middle dot for a space, the arrow for a tab and the ring for a non-breaking space. Set it there once and every document you open afterwards is drawn the same way, this session and the next.
Reading bytes on a very large file
Decide what you are asking of the display before you settle in — Symbols to read the shape of the whitespace alongside the code, Bytes to know exactly what the file will save — and work in that one style. Our large-file engine keeps a document of that size open, scrollable and responsive, so a long file stays as comfortable to read, markers and all, as a short one. When all you want is proof about a single character, copy that line into a new document and read the bytes there: the same answer, in a smaller space.
Getting a count on a very large document
Raise the pill's slider in Settings ▸ Text Cleanup so it keeps watching files of that size, or go straight to Clean ▸ Clean Invisible / Special Characters…, which counts the whole file at any length and hands you every finding with its line, column and code point.
Clean AI Copy/Paste Markers left something behind
That command is deliberately conservative. It strips only artefacts that cannot change visible rendering, wording, tone, punctuation, indentation or emoji structure, and anything needing judgement is counted and left alone — "Cleaned N safe marker(s). R risky marker(s) left unchanged." Use the review sheet for the rest.
They come back every time I paste
Cleaning pasted text is off by default. Turn on Clean pasted text in Settings ▸ Text Cleanup and what you paste is cleaned with your default preset as it arrives. Leave your default preset on Code-safe when you turn this on, and every paste arrives with the space family already turned into ordinary spaces. The Clean on paste checkbox in the Residual Removal Rules window is a different setting, belonging to our cleanup rules rather than to the review sheet, and not a second name for this one — the one to turn on for spaces is the one in Settings.
Find will not match the line
Your search string contains an ordinary space and the document does not, so the two never meet. Clean the document first and the same search matches straight away.
Frequently asked questions
What is the code point of a non-breaking space?
U+00A0, which is C2 A0 in UTF-8. Set the invisibles marker style to Bytes and Note My prints those bytes in place, in the document's own encoding.
Will replacing them change anything else in my file?
Each of the four space categories has a defined action of "replace with an ordinary space", so those characters change and nothing else about them does. Apply, though, acts on every enabled category, and the default Code-safe preset enables 16 of them — trailing whitespace and lone CR among them. Untick the rest in the left-hand table if you want the spaces alone. Either way the whole pass counts as a single undo step, so one ⌘Z puts the document back exactly as it was.
Can I remove them from a selection only?
Yes. The review sheet's scope control has Selection and Whole Document, and the line numbers you see always count from the top of the file, so a Selection scan still tells you the real line.
Does this break emoji or accented characters?
Your emoji and accented letters come through whole. Our hidden-character scanner works in terms of the characters you see on screen, so an emoji or an accented letter is one character to it and stays whole. Emoji families, skin-tone variants and combined letters are reported for information where that helps, and a clean never pulls one apart. You can run a clean over a document full of names, accents and emoji without proofreading it afterwards.
Why does one file show a "Clean" pill and another shows nothing at all?
The popover tells "clean" apart from "not checked" on purpose, so a document nobody has looked at is never reported clean — when it says clean, it has genuinely been read, which is what makes a green pill worth trusting. A file showing nothing sits above the size the pill is currently set to watch, and that size is yours: raise the Scan documents up to slider in Settings ▸ Text Cleanup and it reports on files that big and bigger. The review sheet gives you the full count at any length whenever you want it.