Line Ending Converter
Convert text between Windows (CRLF), Unix (LF) and classic Mac (CR) line endings. Detects the current endings and counts lines.
Last reviewed by the Radiatus Cloud team
Convert text between Windows (CRLF), Unix (LF) and old Mac (CR) line endings.
Need this built for your product?
We design, build & host secure software & APIs.
Convert line endings between CRLF and LF
Different operating systems mark the end of a line differently: Windows uses a carriage return followed by a line feed (CRLF), Unix and macOS use a single line feed (LF), and classic Mac systems used a lone carriage return (CR). These invisible differences cause real problems, from files that display as one long line to spurious changes in version control. This converter normalises your text and rewrites every line ending in the style you choose, and reports how many of each kind it found.
Mixed line endings in a single file are detected and unified, so the output is consistent throughout.
Why line endings matter
Line-ending mismatches are a common source of frustration. A shell script with Windows endings may fail to run, a diff may show every line as changed when only the endings differ, and text copied between systems can look broken. Normalising to LF is standard for code and cross-platform projects, while some Windows tools expect CRLF.
Converting is purely a matter of swapping the end-of-line markers, so the visible content is untouched. All conversion happens locally in your browser, so even large files stay private.
Related tools
- JSON Formatter — Format and beautify JSON in your browser. Pinpoints syntax errors by line and column, flags unsafe integers, and never uploads your data to a server.
- JSON Validator — Validate JSON syntax with precise line and column errors, and check documents against a JSON Schema. Runs locally in your browser, nothing uploaded.
- Regex Tester — Test regular expressions against sample text with live match highlighting, capture groups and flag control. Runs entirely in your browser.
- HTML Minifier — Minify HTML by removing comments and redundant whitespace, without breaking inline elements or pre blocks. Runs entirely in your browser.
Frequently Asked Questions
What is the difference between CRLF and LF?
CRLF is a carriage return plus line feed, used by Windows, while LF is a single line feed used by Unix and macOS. They are invisible control characters.
Which line ending should I use for code?
LF is the standard for code and cross-platform projects. Some Windows-only tools and files expect CRLF, so match your target environment.
Can it fix a file with mixed endings?
Yes. The converter normalises all endings first, then rewrites them uniformly in your chosen style, so mixed files become consistent.
Does converting change the visible text?
No. Only the invisible end-of-line markers change, so the words and layout you see stay exactly the same.
Why do diffs show every line changed?
If two files use different line endings, a line-by-line diff sees every line as different. Normalising the endings resolves these phantom changes.
Privacy & Security
Everything runs in your browser; nothing is uploaded.
How to Use
Paste text, choose the target line ending, and copy the converted result.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
JSON Formatter
DeveloperFormat and beautify JSON in your browser. Pinpoints syntax errors by line and column, flags unsafe integers, and never uploads your data to a server.
JSON Validator
DeveloperValidate JSON syntax with precise line and column errors, and check documents against a JSON Schema. Runs locally in your browser, nothing uploaded.
Regex Tester
DeveloperTest regular expressions against sample text with live match highlighting, capture groups and flag control. Runs entirely in your browser.