Line Break Converter
Convert line endings between Windows (CRLF), Unix (LF), and Mac (CR) formats instantly. Standardise mixed line breaks, remove carriage returns, and prepare text for any system. No signup, no uploads — everything runs right in your browser.
Input & Options
Paste text and choose the target formatConverted Output
ResultsYour converted text will appear here
Paste some text, choose a target format, then click Convert Line Breaks.
What does the Line Break Converter do?
Different operating systems use different invisible characters to mark the end of a line in text files. This line break converter standardises them to the format you choose, so the same file behaves correctly on every system — Windows, Linux, macOS, or any server you drop it on.
The tool understands all three conventions:
- Windows (CRLF):
\r\n— the standard for Windows text files. - Unix (LF):
\n— used by Linux, macOS, Docker containers, and most modern systems. - Mac (CR):
\r— classic Mac OS style, still found in some legacy files.
If your input contains a mix of all three — which happens often when files move between systems — the tool unifies every line ending to the format you select. It also detects and displays a live count of each type so you can see exactly what your input uses.
Everything runs locally in your browser using JavaScript. Your text never leaves your device — there is no server processing, no logging, and no data storage.
How to convert line breaks — step by step
- Paste your text: Drop text with the line endings you want to change into the input box. Any mix of CRLF, LF, and CR is supported.
- Check the detection badges: The tool instantly shows how many CRLF, LF, and CR line endings your input contains — useful for confirming what you're about to convert.
- Pick the target format: Choose Unix (LF) for Linux/macOS/Docker, Windows (CRLF) for Windows text files, or Mac (CR) for legacy files.
- Set options: Optionally trim trailing spaces before each line break, ensure a final newline, remove empty lines, or collapse consecutive blank lines.
- Click Convert Line Breaks: The tool normalises every line ending to your chosen format and shows the result instantly.
- Copy or download: Use the Copy Output button or download the result as a
.txtfile ready for any system.
Shortcut: Press Ctrl + Enter (or Cmd + Enter on Mac) inside the input box to convert instantly.
Line ending reference
| Format | Characters | Name | Used by |
|---|---|---|---|
| Windows | \r\n (CR+LF, 0x0D 0x0A) | CRLF | Windows, DOS, many text editors on Windows, HTTP headers |
| Unix | \n (LF, 0x0A) | LF | Linux, macOS (10+), BSD, Docker, most servers, git default on macOS/Linux |
| Mac (classic) | \r (CR, 0x0D) | CR | Classic Mac OS (pre-OS X), some legacy text files, old documents |
Common use cases
Cross-platform file sharing
- Convert Windows text files to LF before uploading to a Linux server or deploying via CI/CD.
- Convert Unix files to CRLF so Windows-only tools like Notepad display them correctly.
- Standardise mixed line endings from a repository before pushing to git.
Shell scripts and configuration files
- Fix the infamous
^Merror in shell scripts by converting CRLF to LF. - Prepare Dockerfiles, YAML, and shell scripts for Linux deployment.
- Clean up config files that were edited on Windows and then moved to a Unix server.
Development workflow
- Ensure consistent line endings across a team working on mixed operating systems.
- Standardise files before running a diff so git doesn't show spurious changes.
- Prepare source files for linting or code style checks that expect a specific line ending.
Legacy data and documents
- Read old Mac OS text files that use CR line endings and convert them to LF.
- Clean up exports from legacy systems that mix CR and LF.
- Standardise data dumps before analysis.
Why use this Line Break Converter?
Instant conversion
Results appear the moment you click Convert. No server round-trip, no queue, no waiting.
Handles mixed line endings
If your text contains a mix of CRLF, LF, and CR, the tool unifies them all to your chosen format in one pass.
Live detection
See exactly how many CRLF, LF, and CR line endings your input contains before you convert.
100% private
Everything runs in your browser. The text you paste never leaves your device — no server, no logs, no tracking.
Copy or download
Copy the converted text to your clipboard, or download it as a .txt file with the new line endings already applied.
Works on mobile
Fully responsive. Convert line endings from a phone, tablet, or desktop — no app install required.
Tips and best practices
- Check the detection badges first. If your input has a lot of CR characters and you only want LF, you can see at a glance what you're about to strip.
- Use Unix (LF) for anything headed to a server. Linux, macOS, Docker, and most CI/CD pipelines expect LF. Converting CRLF to LF is the single most common use of this tool.
- Use Windows (CRLF) for files that will only ever be opened in Notepad on Windows. Modern editors handle LF fine, but legacy Windows tools still expect CRLF.
- Trim trailing spaces if your source has them. Trailing whitespace before line breaks is a common cause of noisy git diffs. The option fixes that in one pass.
- Ensure final newline for POSIX compliance. Many Unix tools (including git and diff) expect the last line to end with a newline. Enable this option if you're preparing files for a Unix environment.
- Don't convert binary files. This tool works on text. Converting the line endings of a PNG, ZIP, or PDF will corrupt it.
- Pair with Text Statistics. Need to see a full breakdown of your text, including how many of each line break type it has? Use our Text Statistics tool.
Related tools you might need
- Remove Line Breaks — join all lines into one continuous line.
- Whitespace Cleaner — clean up spaces, tabs, and blank lines.
- Remove Empty Lines — delete blank lines only.
- Join Lines — merge multiple lines into one paragraph.
- Unwrap Text — merge broken lines into paragraphs.
- Text Statistics — full summary including line break breakdown.
- Text Cleaner — full cleanup pipeline.
- Line Counter — count lines in your text.
Privacy, accuracy, and limits
Privacy: Nothing you paste into this converter is sent to a server. The whole conversion is JavaScript that runs entirely in your browser tab. There is no upload, no queue, no analytics event that includes your text, and no server-side log.
Accuracy: The tool uses a precise character-level scan to detect CRLF, LF, and CR. It correctly handles files with mixed line endings and normalises them all to your chosen format. The trim and final-newline options are applied after conversion, so results are always consistent.
Limits: There is no hard limit on input size. Since everything runs in-browser, the practical limit is your device's memory. Text files of several megabytes process in well under a second.
Frequently asked questions
\r\n. LF (Line Feed) is Unix, Linux, macOS, and modern systems standard — one character, \n. CR (Carriage Return) was used by classic Mac OS before OS X — one character, \r..txt file with the new line endings already applied.