How the Line Break Formatter works
Remove line breaks joins the lines of each paragraph into one line, with a single space where each break was, and removes spaces left at the ends of the lines. A blank line marks a new paragraph: with "Keep paragraph breaks" ticked, paragraphs stay separated by one blank line; untick it to join everything into a single line. This is useful for text copied from PDFs and emails, where every line ends with a hard break.
Add line breaks wraps each line at the width you choose, breaking only between words, and keeps the indentation of the line on the wrapped lines. Width is measured in characters as they appear on screen, so an emoji or an accented letter counts as one. A word longer than the width stays on its own line unless you tick "Break words longer than the width". Existing line breaks are kept.
Line endings are the invisible characters at the end of each line: LF on Linux and macOS, CRLF on Windows and CR on classic Mac OS. The tool counts the endings in your input and writes the ending you choose. Browsers turn every line break typed or pasted into a text box into LF, so pasted text always reports LF. To see a file's real line endings, use Open file: the tool reads the file before it is shown in the text box. The text box cannot display CR characters either, so the Download button (and Copy) use the exact result with the chosen line endings.
How to use the Line Break Formatter
- Paste your text into the Text box, or select Open file to also detect the file's original line endings. Select Load example to try it.
- Under What to do, choose Remove line breaks, Add line breaks (wrap at a width) or Convert line endings only, and set its options, such as Keep paragraph breaks or the Maximum line width.
- Choose the Line endings in the result: the same as the input, LF, CRLF or CR. The result updates as you type, or select Format line breaks.
- Select Download to save the result with the chosen line endings, or Copy to copy it. The line under the result shows the line endings found in the input and written to the result.
Example
This text, with a hard break in the middle of each paragraph:
The quick brown fox
jumps over the lazy dog.
Pack my box with
five dozen liquor jugs.
with Remove line breaks and Keep paragraph breaks becomes:
The quick brown fox jumps over the lazy dog.
Pack my box with five dozen liquor jugs.
Wrapping that result at a width of 20 characters gives:
The quick brown fox
jumps over the lazy
dog.
Pack my box with
five dozen liquor
jugs.
Common use cases
- Joining text copied from a PDF or email, where every line ends with a hard line break, into normal paragraphs.
- Wrapping plain-text emails, commit messages or README files at 72 or 80 characters.
- Converting a script or configuration file from Windows CRLF to Unix LF line endings before using it on Linux.
- Checking whether a file uses CRLF, LF or a mix of both.
Common errors and how to fix them
- Choose LF, CRLF or CR as the line ending
- No target convention was selected. LF suits Linux, macOS and Git; CRLF suits Windows tools such as Notepad and some CSV importers.
- The file still opens as one long line
- The program reading it expects a different convention. A file written with LF shows as a single line in older Windows editors, and CRLF can leave visible stray characters on Linux. Convert to whatever that program expects.
- Git now reports every line as changed
- Converting line endings changes every line, so the whole file shows as modified. Settle on one convention per repository and record it in a .gitattributes file instead of converting files by hand.
- Enter a whole-number line width between 1 and 10,000
- The wrap width is blank or out of range. Use 80 or 120 for code, or leave wrapping off if you only want to change line endings.
Frequently asked questions
What is the difference between CRLF, LF and CR?
They are the invisible characters that end a line. Windows uses CRLF (carriage return plus line feed), Linux, macOS and most programming tools use LF, and classic Mac OS before OS X used CR. Using the wrong one can break shell scripts, show up as ^M characters or make every line of a file appear changed in version control.
Why does pasted text always show LF line endings?
Browsers convert every line break in a text box to LF, so the original line endings of pasted text cannot be seen. To detect them, use Open file: the tool reads the file directly and counts its CRLF, LF and CR endings before the text is shown in the box.
Does the result really use CRLF if the text box shows LF?
Yes. The text box can only display LF, but the tool keeps the exact result separately, and the Download and Copy buttons use it, so a downloaded file has the line endings you chose.
How does removing line breaks treat paragraphs?
Lines are joined with a single space, and spaces at the ends of the joined lines are removed. A blank line marks a paragraph break. With Keep paragraph breaks ticked, paragraphs are separated by one blank line; without it, the whole text becomes one line.
How does wrapping work?
Each line longer than the maximum width is broken between words so that no line is longer than the width, and the line's indentation is repeated on the wrapped lines. Width is measured in characters as displayed, so an emoji counts as one. A single word longer than the width stays whole unless you tick Break words longer than the width.
Is my text uploaded?
No. Everything runs in your browser, including reading opened files, and nothing is sent to our server.