Text Studio · Windows 10 and 11
Remove line breaks from text
Text copied from a PDF, an email or a scan often breaks at the end of every line. Text Studio joins those lines back into flowing paragraphs and keeps the gaps between them, or turns the whole thing into one line when that is what you need. Both are one click in the Clean menu, and Ctrl Z puts the breaks back.
How to remove line breaks
- 1
Paste what you copied
Paste the text from the PDF or email into Text Studio, or open the .txt file it came in.
- 2
Join broken lines
Open Clean and choose Join broken lines. The lines inside each paragraph become one; the empty lines between paragraphs stay.
- 3
Or make it one line
Choose Remove all line breaks instead when everything should sit on a single line, with a space where each break was.
- 4
Check and copy
The line count at the bottom drops as lines join. Copy all, or Save to write it back to the file.
Why copied text breaks
A PDF does not store paragraphs. It stores lines of text placed on a page, so copying from one gives you a line break at the end of every printed line, often in the middle of a sentence. Other sources do the same:
- Plain-text email, which is often wrapped at about 72 to 78 characters a line; the email standard recommends lines of no more than 78.
- Scans and photos: image to text gives you the words line by line, just as they sat on the page.
- Subtitle files, where one caption is split over two lines.
- Old text files and terminal output, wrapped to fit a screen.
Paste that into a document, a form or a chat and you get ragged lines that end in odd places. Joining them gives the text back the shape it was written in.
Join broken lines or Remove all line breaks?
| What happens | Join broken lines | Remove all line breaks |
|---|---|---|
| Lines inside a paragraph | Joined with a space | Joined with a space |
| Empty lines between paragraphs | Stay | Go: paragraphs run together |
| Spaces next to a break | Folded into one space | Folded into one space |
| Good for | Articles, reports, quotes from a PDF | A form field, a spreadsheet cell, a search box |
To Text Studio, a paragraph is a block of lines with an empty line before and after it, and a line that holds only spaces counts as empty. That is how Join broken lines tells the breaks you want gone from the ones you want to keep.
It follows that on a text with no empty lines at all, the two choices give the same result: one long block. Add the paragraph gaps first, or select one paragraph at a time, and Join broken lines has something to keep.
Things to check after joining
- No empty lines in the copy. Some PDFs space their paragraphs apart on the page without leaving an empty line in the text. Press Enter at each paragraph start before joining, so the gaps exist.
- Lists and headings join onto the next line. Leave an empty line after them, or select only the running text.
- Words broken with a hyphen at a line end come out as “exam- ple”. Open Find, turn on Pattern, find (\p{L})- (\p{L}) and replace with $1$2. A word that really has a hyphen, such as well-known, loses it too if it broke at that spot, so read the result.
- Quoted email replies keep the > mark at the start of each old line, and joining moves those marks into the middle of sentences. Remove them before joining: with Pattern on, find (^|\n)> ? and replace with $1.
From a list to one line
Remove all line breaks turns a column of items into one line separated by spaces. When the items need commas, as in addresses for the To box or tags for a form, use find and replace instead: turn on Pattern, find \s*\n\s*, replace with a comma and a space, and choose Replace all. Three lines reading apples, pears and plums become “apples, pears, plums”.
Microsoft Word can do a similar job: its Replace box finds ^p, a paragraph mark, and ^l, a manual line break, and can swap them for a space. The catch is that ^p also ends every real paragraph, so they all run together unless you mark the real breaks first. Join broken lines tells the two apart by the empty line.
Questions, answered
Will my paragraphs survive?
With Join broken lines, yes, as long as an empty line separates them. Remove all line breaks runs everything together on purpose.
Can I join only part of the text?
Yes. Both choices in Clean change only what you select, so select the part first; with no selection they cover the whole text.
Does it also remove double spaces?
The spaces around each line break become one. Doubled spaces elsewhere in a line stay; Collapse extra spaces, in the same menu, takes care of them.
Can I use it on a subtitle file?
Only on the words. In an .srt file each caption's number, times and text are separate lines, so joining a whole block breaks the file. Select a caption's two text lines and join just those.
Can I undo it?
Yes. Ctrl Z brings the line breaks back exactly as they were, and your file changes only when you save.
Is the text kept private?
Yes. Pages copied out of contracts, statements or reports are joined in Text Studio on your own PC; nothing is sent anywhere to do it.
Remove line breaks, and 16 more apps.
Download for Windows7 days free, then from $3.99 a month for all 17 apps. Windows 10 and 11.