Remove Line Breaks in LibreOffice

Learn how to remove line breaks in LibreOffice Writer using Find & Replace. Step-by-step instructions for removing inserted line breaks without deleting real paragraphs.

Before you start

This guide covers LibreOffice Writer, the word-processing application included with LibreOffice. You only need a Writer document that contains unwanted line breaks. The process runs locally on your computer and does not require an internet connection or a service.

There are two common types of line breaks in Writer: paragraph breaks and line breaks inserted within a paragraph. A paragraph break is created with Enter, while a line break is usually created with Shift+Enter. The Find & Replace method described below can target either type, but you need to know which one is causing the problem because the search expression is different.

Keep a copy of the original document before making bulk changes. Find & Replace can affect the whole document quickly, so a backup makes it easier to return to the previous state if the result is not what you expected.

Step-by-step instructions

Remove line breaks inserted with Shift+Enter

  • Open the document in LibreOffice Writer.
  • Press Ctrl+H to open the Find & Replace dialog.
  • In the Find field, type the regular expression for a line break: \n
  • In the Replace field, type a single space.
  • Click More Options and enable Regular expressions.
  • Click Replace All.
  • Review the changed text and adjust spacing where necessary.

In LibreOffice regular expressions, \n represents a line break within a paragraph. This is different from a paragraph end, which uses a separate expression. If the unwanted line breaks were created with Shift+Enter, this method can remove them while leaving real paragraphs intact.

Remove paragraph breaks

If the document has unwanted paragraph breaks, the search expression is different. Use the regular expression $ in the Find field to match a paragraph end. Put a space in the Replace field, enable Regular expressions, and use Replace All. This is more intrusive because it can join headings, list items, and separate paragraphs, so it is usually safer to replace a few occurrences at a time.

Check the output

After replacing line breaks, check that sentences are still separated by a space. If the original line break did not leave a space, two words may become joined. You can use Find & Replace again to search for common merged-word patterns, but manual review is the most reliable check for short documents.

Also confirm that the document still has the intended paragraph structure. Removing paragraph breaks can merge headings into body text or combine numbered list items, so check those areas before saving.

Common problems and next steps

The most common problem is using \n when the document contains paragraph breaks instead of line breaks. If Replace All appears to do nothing, open a copy of the document and search for $ with Regular expressions enabled to check whether the breaks are paragraph ends.

Merged words can appear when a break is removed without adding a space. To reduce this, replace line breaks with a space rather than an empty value. If you need to remove a line break only when it is not already followed by a space, you may need a more specific regular expression, but the safest approach is to let the replacement add a space and then review any double spaces.

If the document structure is important, work on a copy and replace only a selected range instead of the entire document. You can select a portion of text and use Replace All within that selection, which limits how much of the file is changed at once.