Video demo
Free Line Ending Converter — Switch Between LF (Unix) and CRLF (Windows)
Paste text and convert its line endings between LF (Unix/macOS) and CRLF (Windows) — the quick fix for cross-platform editor glitches, broken scripts, and noisy diffs. Everything runs locally in your browser.
Loading tool interface...
What is Line Ending Converter?
A line ending is the invisible character (or characters) that marks where one line stops and the next begins. The two that matter today are LF (a single line-feed, used by Unix, Linux, and modern macOS) and CRLF (a carriage-return followed by a line-feed, used by Windows). A third, a lone CR, was used by classic Mac OS and still turns up occasionally. They look identical on screen — the difference is in the bytes — which is exactly why mismatched line endings cause bugs that are maddening to diagnose: the text looks fine, but a program reading the bytes behaves differently.
This converter normalises a block of text to whichever style you choose. It reads what you paste, replaces the line-ending sequences consistently, and gives you back clean output — entirely in the browser, with no upload. That last point matters because line-ending problems often involve source code, configuration, or scripts you would rather not paste into a server-side service. Here the bytes are transformed locally and never leave your machine.
The classic symptom of a line-ending mismatch is a shell script that fails with a confusing error. A Bash script saved with Windows CRLF endings carries a trailing carriage return on every line; the shell tries to execute an interpreter path with an invisible CR appended and reports something like "bad interpreter: No such file or directory," or a command "not found" that plainly exists. Converting the file to LF fixes it instantly. The same class of problem hits Dockerfiles, entrypoint scripts, cron entries, and any file that a Unix system parses line by line.
The other place this bites is version control. If a file's line endings flip — because a teammate's editor saved CRLF where the repo uses LF — git can show the entire file as changed even though not a single visible character differs. That produces enormous, meaningless diffs that bury the real change and make code review painful. Normalising line endings before committing keeps diffs honest. Git's own autocrlf setting and a gitattributes file are the durable fix, but a quick manual conversion is often what you need to clean up a specific file or a snippet right now.
Beyond scripts and git, consistent line endings keep data files parsing predictably — CSVs moving between Windows and Unix systems, log files concatenated from mixed sources, and text fixtures in a test suite. Choosing one convention and converting to it removes a whole category of "works on my machine" surprises. For most modern, cross-platform work the safe default is LF; convert to CRLF only when a specific Windows tool or a legacy system requires it.
- 1
Paste your text
Drop in the code, script, config, or data whose line endings you want to normalise. Mixed endings in the same input are fine — they will all be unified.
- 2
Choose the target style
Pick LF for Unix, Linux, macOS, and most cross-platform work, or CRLF when a Windows tool or legacy system specifically requires it.
- 3
Convert
The tool rewrites every line ending to the chosen style consistently, so there are no leftover mixed endings.
- 4
Copy the clean output
Copy the normalised text back into your editor, file, or repo. The original never left your browser.
- Converts cleanly between LF and CRLF (and normalises stray CR) in one step
- Fixes shell scripts that fail with "bad interpreter" errors from Windows endings
- Eliminates giant, meaningless git diffs caused by flipped line endings
- Unifies mixed line endings in a single block of text
- Runs locally — code, config, and scripts are never uploaded
- No account, no size friction, works offline once loaded
A developer whose Bash script fails with "bad interpreter" on a Linux server pastes it in, converts CRLF to LF, and the script runs immediately.
A team member on Windows normalises a config file to LF before committing so the pull request shows the real change instead of the whole file marked as modified.
A data engineer unifies a CSV exported from a Windows tool to LF before loading it into a Unix pipeline that chokes on carriage returns.
A DevOps engineer fixes a Dockerfile entrypoint script that breaks in the container because it was saved with Windows line endings.
A writer moving notes between a Windows editor and a Mac normalises the text so a downstream parser stops inserting blank lines.
A QA engineer cleans a test fixture with mixed line endings so string comparisons in the test suite stop failing for invisible reasons.
Line-ending bugs are invisible — the text looks correct, so people lose real time guessing. A converter that just normalises the bytes turns a baffling "bad interpreter" or a 2,000-line phantom diff into a five-second fix.
It runs locally, which matters because the files involved are usually source code, scripts, or configuration. There is no reason to upload a Dockerfile or an internal config to a server just to swap CR-LF for LF, and here you do not have to.
It handles mixed input. Files that have been edited on multiple platforms often contain a blend of LF and CRLF; the tool unifies everything to one convention instead of leaving a half-converted mess.
No account and offline capability make it dependable in exactly the moments you need it — fixing a script on a locked-down work laptop or behind a firewall that blocks third-party services.
Continue this workflow with nearby browser-based tools so you can validate, convert, and ship output without context switching.
- Free file tools tools category pageSee every browser-based file tools workflow in one index.
- About this siteWho built these tools and why everything runs in your browser.
- Browser-based word & character counterCount words, characters, sentences, and estimate reading time — with keyword density analysis.
- Browser-based case converterConvert text between upper, lower, title, camelCase, snake_case, and kebab-case — one-click text transformation.
- Browser-based json formatter & validatorFormat, validate, and minify JSON with error highlighting — instantly beautify messy JSON responses.
- Browser-based base64 encode/decodeEncode and decode text to and from Base64 format instantly in your browser — essential developer utility.
- Browser-based url encode/decodeEncode and decode URLs with percent-encoding support — fix broken query strings and API parameters instantly.
Line Ending Converter FAQs
Quick answers about the workflow, privacy, and where this tool fits in a broader job.
What is the difference between LF and CRLF?
LF is a single line-feed character used by Unix, Linux, and modern macOS. CRLF is a carriage-return followed by a line-feed, used by Windows. They look the same on screen but differ in the underlying bytes, which is why mismatches cause hard-to-spot bugs.
Why does my shell script fail after editing on Windows?
Windows saves CRLF endings, which leave a trailing carriage return on every line. A Unix shell then tries to run an interpreter path with an invisible CR appended and reports errors like "bad interpreter: No such file or directory." Converting the file to LF fixes it.
Will this fix the huge diffs git shows for an unchanged file?
Yes. Those diffs usually come from line endings flipping between LF and CRLF. Normalising the file to your repo's convention before committing makes the diff reflect only the real change. For a durable fix, also configure git's autocrlf and a gitattributes file.
Which line ending should I use?
For most modern, cross-platform work, LF is the safe default. Convert to CRLF only when a specific Windows application or a legacy system requires it.
Can it handle text with mixed line endings?
Yes. If the input contains a blend of LF and CRLF (common in files edited on multiple platforms), the tool unifies them all to the single style you choose.
Is my text uploaded to a server?
No. The conversion happens entirely in your browser, so code, configuration, and scripts never leave your device. The tool also works offline once the page has loaded.
Is it free?
Yes — no account, no limit, and no paid tier. Unobtrusive display ads keep the site free to use.
Related Free Online Tools
Keep the workflow moving with nearby tools that solve the next likely step.
Word & Character Counter
Count words, characters, sentences, and estimate reading time — with keyword density analysis.
Explore free word & character counter
Case Converter
Convert text between upper, lower, title, camelCase, snake_case, and kebab-case — one-click text transformation.
Explore free case converter
JSON Formatter & Validator
Format, validate, and minify JSON with error highlighting — instantly beautify messy JSON responses.
Explore free json formatter & validator
Base64 Encode/Decode
Encode and decode text to and from Base64 format instantly in your browser — essential developer utility.
Explore free base64 encode/decode
URL Encode/Decode
Encode and decode URLs with percent-encoding support — fix broken query strings and API parameters instantly.
Explore free url encode/decode
Last updated:
Tested in Chrome, Firefox, and Safari on desktop and mobile.