Line Break Tool
Add or remove line breaks from text.
How to use Line Break Tool
What this tool does
The Line Break Tool handles three distinct operations on line breaks in text: it can remove them, add them, or convert them between the three standard formats. Choose the mode from the segmented control at the top, paste your text, and the result appears immediately.
In Remove line breaks mode the tool strips every line break and replaces each one with a separator you specify — typically a space, to join paragraphs into a single running line, but you can use any string. In Add line breaks mode it re-wraps plain text to fit within a column width you set, breaking at word boundaries so no word is cut in half. In Convert line endings mode it normalises all line endings in the text and rewrites them as Windows CRLF, Unix LF, or classic Mac CR, whichever you choose.
Why you might need it
These three operations come up constantly in everyday text work.
Removing line breaks is essential when you paste a block of text — a quote from a PDF, a paragraph from a web article, or an export from a spreadsheet — and it arrives with hard line breaks that break the flow. Turning them into spaces produces a single, clean paragraph ready to paste into an email or document.
Adding line breaks is the reverse need: a long single-line string that arrived
from a database export, a minified configuration file, or a template system needs
to be wrapped to be human-readable. Editors like Vim and Emacs have gq and
fill-paragraph for this, but not everyone has those tools available. Setting a
column width of 72 or 80 characters and letting the tool wrap the text produces
clean output that fits a terminal or a diff view.
Converting line endings is a quiet but persistent source of bugs. A shell script
with CRLF endings will fail on Linux with a bad interpreter error. A CSV file
with mixed endings may be parsed inconsistently. Normalising before distribution
prevents a whole class of cross-platform problems.
How to use it
- Choose the mode you need from the Remove line breaks, Add line breaks, or Convert line endings options at the top.
- Paste your text into the Your text box, or use Load sample to try the tool with a pre-loaded example.
- Set any mode-specific options: for Remove, type the replacement string; for Add, enter the column width; for Convert, pick the target line ending.
- Read the result in the Result box below, which updates in real time.
- Use Copy output to put the result on your clipboard, then Clear to start fresh.
Common pitfalls
In “Remove line breaks” mode, leaving the replacement field empty will concatenate lines directly, which means the last word of one line and the first word of the next run together without a space. That is almost never what you want for prose. Leave it set to a single space unless you specifically need run-together output.
In “Add line breaks” mode, the tool first collapses any existing line breaks into spaces so it can re-wrap cleanly from scratch. If you have intentional paragraph breaks and want to preserve them, split the text into paragraphs first, process each separately, and rejoin.
In “Convert line endings” mode, some editors display CRLF files correctly but store them with invisible characters that cause issues in other tools. If your file looks right on screen but misbehaves in a terminal or version control, a conversion to LF is often the fix.
Tips and advanced use
The 72-character column width is a long-standing convention for email body text, where many clients impose a hard wrap at 76 or 78 characters and a margin of a few characters gives you room. The 80-character width suits most terminal windows. Git commit message bodies conventionally wrap at 72 characters.
For Markdown files, wrapping at 80 columns with a word-aware break makes diffs much more readable in code review tools, since each diff hunk shows a manageable number of changed words rather than a single enormous line.
Converting to LF before committing to a Git repository, combined with a
.gitattributes file that enforces LF for text files, avoids the common
situation where one contributor on Windows submits CRLF files and another on
Linux sees every line as changed. The conversion step here handles the immediate
file; the .gitattributes file handles the long term.
All processing runs locally in your browser, so you can safely use this tool with sensitive documents, configuration files containing credentials, or any other content you would not want to send to an external service.
Frequently asked questions
Does this tool send my text to a server?
What is the difference between CRLF, LF, and CR?
How does the word-aware wrapping work?
What can I use as the replacement when removing line breaks?
Why might I need to convert line endings?
Related tools
Whitespace Remover
Remove extra spaces, tabs, and blank lines from text.
Remove Duplicate Lines
Delete duplicate lines from a list of text.
Sort Lines
Sort lines alphabetically, numerically, or by length.
Text Repeater
Repeat any text a set number of times.
Find and Replace
Find and replace text, with optional regex support.
Paragraph Counter
Count the paragraphs in your writing.