How to Fix Broken Line Breaks in Text Copied from a PDF
Why text copied from a PDF breaks mid-sentence, and how to repair line breaks, rejoin hyphenated words and remove page numbers and headers, with examples.
When you copy a paragraph from a PDF report or paper and paste it into an email or document, a line break appears at the end of every line you saw on screen and the sentences come out in pieces. Deleting them one by one takes a long time, even for a few pages. This guide explains the cause and the order of steps that cleans it up.
Why do the lines break?
PDF is a format that places characters at coordinates on a page. In many cases no unit such as a 'paragraph' is stored, as it would be in a Word document, so when you copy, the PDF viewer outputs each line on screen as a separate line. The result is a line break at the end of every line inside a paragraph. English documents have an extra problem: typesetting that splits words with a hyphen at the end of a line, so a word can end up in two pieces, such as infor- and mation.
The basic pipeline
The built-in recipe consists of the four steps below.
- Clean invisible characters and quotes — first cleans up the NBSP, zero-width characters and curly quotes that tag along from PDFs.
- Repair PDF line breaks — keeps blank lines as paragraph boundaries and joins the lines within each paragraph.
- Collapse repeated spaces and tabs — shrinks the runs of spaces created by justified alignment to a single space.
- Trim leading and trailing spaces — removes the spaces left at the start and end of lines.
- Clean invisible characters and quotes
- Repair PDF line breaks
- Collapse repeated spaces and tabs
- Trim leading and trailing spaces
Repair PDF line breaks joins Latin and Korean lines with a single space, and joins characters written without spaces, such as Chinese characters and Japanese kana, directly with no space. Lines starting with a bullet or number such as -, • or 1. stay on their own line, so lists are not squashed into one block.
This report was written based on survey results from the second half of 2025. - Respondents: 1,204 - Survey period: November
The input above is cleaned up as follows.
This report was written based on survey results from the second half of 2025. - Respondents: 1,204 - Survey period: November
Joining with a space is right for English, but in Korean text a space can be inserted where there originally was none, for example when a word and its ending were split across two lines. The tool cannot know whether a line break was originally a space, so read through the result once.
Words split by hyphens
With 'Rejoin words hyphenated at line ends' turned on, the two pieces are merged only when the previous line ends with a letter and - and the next line starts with a lowercase letter. If the next line starts with a capital letter or a digit, they are not merged, so a spelling like COVID- / 19 is joined with a space in between. A compound word that genuinely contains a hyphen (long- / term) may be merged into longterm if the hyphen falls at the end of a line, so check the result.
When page numbers and headers get mixed in
If you copy several pages at once, headers and footers such as page numbers, the document title and the date get wedged into the body text. If these lines sit inside a paragraph, they are joined into the body along with it, so the line filter must come before Repair PDF line breaks.
- Add Filter lines at the very top of the pipeline and set the action to 'Remove matching lines'.
- Turn on 'Regex' and enter
^\d+$as the search text to remove lines consisting only of digits (page numbers). - If there are spaces around the page numbers, use
^\s*\d+\s*$; for the- 12 -style, use^\s*-\s*\d+\s*-\s*$. - For a repeated header, turn regex off and enter the text itself (for example, the document title) to remove it. You can have several filter steps.
If the header text also appears inside a sentence in the body, that line is removed too, so choose a part that is unique to the header as the search text.
Be careful with two-column PDFs
With PDFs where each page is split into two columns, as in academic journals, some viewers copy the lines of the left and right columns interleaved. In that case the line order itself is wrong, and no line break cleanup can fix it. Drag-select and copy one column at a time in the viewer, then paste.
When paragraphs follow each other without blank lines
In a PDF with no blank lines between paragraphs, every line may be merged into a single paragraph. With 'Treat short lines ending in punctuation as paragraph ends' on, a line that ends with a period or similar mark and is clearly shorter than the longest line in the paragraph is treated as the end of the paragraph, and the line is split there. It is an estimate, so a short sentence that happens to fall at the end of a line may be split incorrectly.
Tables, footnotes and captions
When copied, tables in a PDF often come out with cells separated only by spaces, or with each cell on its own line. Cleaning them up together with the body text runs the cell values together like a sentence, so it is better to copy tables separately from the body. Footnote numbers are sometimes copied as digits of the same size as the body text and stick to the preceding word, as in the result.3. The tool cannot tell a footnote number from a number in the text, so remove them yourself where needed. A caption wedged between body paragraphs without blank lines may be merged with the paragraphs around it.
Save frequent settings as a recipe
If you changed the pipeline, for example by adding a page number filter, give it a name and save it as a recipe. When you clean up PDFs with the same layout many times, such as reports from the same organization, you will not have to rebuild the steps. Recipes are saved only in this browser, and the text you paste is never sent to a server.
Checklist
- Put the page number and header filters before the repair step.
- Copy two-column documents one column at a time.
- Check hyphenated compounds and Korean word spacing in the result by eye.
Last updated: 2026-09-23