CRLF to LF Line Break Normalizer
Convert Windows CRLF line endings to Unix LF (or back), count mixed line breaks and add a final newline.
- 100% free
- Private in browser
- No signup
- No watermarks
Normalized text
—
Rate this tool
Be the first to rate — helps others and improves this page.
About CRLF to LF Line Break Normalizer
Mixed line endings cause noisy Git diffs, broken shell scripts ("bad interpreter: ^M") and failing linters. Paste your text to see how many CRLF, LF and CR breaks it contains, then convert everything to one style and copy or download the result.
How to use CRLF to LF Line Break Normalizer
- Paste the text or file contents with mixed line endings.
- Choose LF, CRLF or CR as the target line ending.
- Optionally trim trailing spaces and ensure a final newline, then copy or download the result.
Key features
- Counts CRLF, LF and lone CR line breaks
- Converts to LF, CRLF or CR in one click
- Optional trailing-whitespace trimming
- Ensures a single final newline (POSIX style)
- Shows bytes saved; runs in your browser
Frequently asked questions
- What is the difference between CRLF and LF?
- Windows ends lines with carriage return + line feed (\r\n, CRLF). Linux and macOS use a single line feed (\n, LF). Classic Mac OS used a lone carriage return (\r).
- Why do CRLF line endings break shell scripts?
- Bash treats the \r as part of the command, so a script saved with CRLF fails with errors like "/bin/bash^M: bad interpreter". Converting to LF fixes it.
- How do I stop Git from changing line endings?
- Add a .gitattributes file such as "* text=auto eol=lf", or set core.autocrlf appropriately for your platform, then renormalize once with this tool or git add --renormalize.
- Why add a final newline?
- POSIX defines a line as ending with a newline. Many tools and linters expect it, and Git shows "No newline at end of file" otherwise.
- Is my text uploaded?
- No. Conversion happens entirely in your browser.
Related In-Depth Guides
Learn practical workflows, real-world examples, and expert tips in our comprehensive guides:
Password Entropy Explained: How Bits Measure Brute-Force Cracking Time
Understand Shannon entropy in passwords, character pool combinations, and how many seconds, years, or millennia it takes GPUs to crack modern passphrases.
How to Convert Docker Run Commands to Docker Compose YAML Files
A comprehensive developer guide to transforming complex docker run commands into clean, maintainable docker-compose.yml files.
Web Accessibility & Color Contrast (WCAG 2.1): How to Design AA & AAA Palettes
A practical guide to color contrast ratios, accessibility compliance, WCAG 2.1 AA/AAA standards, and building accessible UI palettes.