Remove Line Breaks From Copied Text on Mac
Remove Line Breaks From Copied Text on Mac
You copy a paragraph from a PDF or an email, paste it somewhere, and it arrives shattered into a dozen short lines. Each line ends with a hard break that does not belong. Fixing it by hand, deleting one return at a time, is tedious. Here is how to do it in one step on a Mac.
Why copied text has broken line breaks
PDFs, terminal output, and some email clients store text with a line break at the end of every visual line, not at the end of every paragraph. When you copy and paste, those breaks come along. The result looks fine in the source but wrong everywhere else.
Find-and-replace can fix this, but it is fiddly: you have to decide which breaks are real paragraph breaks and which are not, and you risk gluing paragraphs together.
The one-step fix with Clean
ClipHistory includes a Clean transform built for exactly this. It strips stray line breaks and collapses extra spaces while leaving real paragraph structure intact.
The steps:
- Copy the broken text (Cmd+C).
- Press Cmd+Shift+V to open your clipboard history.
- Select the clip and run the Clean transform.
- Paste the cleaned text (Cmd+V).
Your original messy clip stays in history, so nothing is lost if the cleanup is too aggressive for a particular case.
What Clean does and does not change
Clean targets formatting noise: hard line breaks mid-sentence, doubled spaces, and similar artifacts. It does not rewrite your words or change meaning. If you also want to rephrase the text, that is a separate Rewrite transform you can run afterward.
Clean uses your own AI key
The Clean transform runs through the AI provider you connected: Anthropic, OpenAI, DeepSeek, Google, or a custom endpoint. You supply the API key, so you pay your provider directly and decide where the text goes. There is no ClipHistory account and no hosted relay.
Only the text you clean is sent out, and only when you ask. Your full clipboard history stays on your Mac.
When a plain-text paste is enough
Sometimes the issue is not line breaks but rich formatting, fonts, colors, links, carried over from the source. For that, pasting as plain text often suffices. Clean is the better choice when the structure itself, the breaks and spacing, is the problem.
Keep a clean version handy
If you regularly clean the same boilerplate, for example a signature or a disclaimer that always arrives mangled, save the cleaned result as a snippet. Then you paste the good version directly instead of cleaning it each time.
Chain it with other transforms
Clean is often the first step in a longer flow. Clean text copied from a PDF, then Summarize it, or Clean then Translate. Because each transform produces a new clip, you can stack them without losing the original or any intermediate version.
A common real case: you copy a multi-page report from a PDF, and it arrives with a hard break after every line and a header repeated on each page. Run Clean to collapse the broken lines, then Summarize the cleaned clip to get the gist. Trying to summarize the raw, broken text first usually gives a worse result, because the line noise confuses the structure the model is reading.
Where the work happens
The Clean transform runs through the AI provider you connected with your own API key, one of Anthropic, OpenAI, DeepSeek, Google, or a custom endpoint. There is no ClipHistory account and no hosted server in between. Only the clip you clean is sent, and only when you ask. Your clipboard history itself is stored locally on your Mac and never synced anywhere.
That local-first design is the reason Clean is safe to use on text you would not paste into a random website, internal documents, contract excerpts, or notes. If even that is too much exposure, point ClipHistory at a self-hosted endpoint and the text never leaves infrastructure you run.
When the breaks are the only problem
Not every cleanup needs AI. If all you ever do is strip line breaks from the same kind of source, you can build a habit around it: copy, Cmd+Shift+V, Clean, paste. After a few times it becomes automatic. The advantage of having it in the clipboard is that the fix is always in the same place no matter which app you copied from, a PDF reader, a terminal, an email, a chat window. You are not hunting for a different tool each time.
And because ClipHistory keeps your last 150 unpinned clips, you can clean several pieces in a row and still retrieve any of the originals. If you pin a clip, it stays indefinitely, which is useful for reference text you clean and reuse often.
Requirements
ClipHistory is a universal binary for Apple Silicon and Intel Macs, signed and notarized by Apple, and it needs macOS 12 or later. It is a one-time $19.99 purchase for a 12-month license with no auto-renewal. The clipboard history holds 150 unpinned clips plus unlimited pinned ones, so the source text you cleaned is still there when you need it.
Get ClipHistory for macOS for a one-time $19.99 at https://cliphistory.com/download and clean copied text in one step.