About Line Ending Converter
Convert between LF (Unix), CRLF (Windows), and CR (classic Mac) line endings. Detects the current style and reports counts for each variant. Useful when a file mixes line endings, when a script expects one specific style, or when you cannot find why a parse fails.
Why line endings still bite
Three operating systems, three conventions. Most modern tools handle all three, but the cases where they don’t are the ones you remember:
- Bash scripts with CRLF endings — fail with “bad interpreter”
- Java property files mixing styles — values include
\rliterally - Diff noise — a file converted between editors shows every line as changed
- CSV imports — Excel saves CRLF; some parsers double-count
Quick detection
The tool’s header shows: “172 LF, 0 CRLF, 0 CR — Unix style”. A mixed file shows the count of each. Convert to a uniform target with one click.
Common workflows
Fix a CRLF Bash script. Convert to LF, redeploy, no more interpreter errors.
Normalize before diff. Convert both files to LF, diff. Whitespace-only differences vanish.
Prepare for a Windows tool. Convert to CRLF for tools that explicitly require it.
Audit a teammate’s export. Different OS, different default. Detect-and-convert keeps the repo consistent.
Why one click matters
The conversion is a one-liner in shell (tr -d '\r', sed -i 's/$/\r/'), but having to remember the magic invocation under pressure is friction. A click is faster.
Frequently asked questions
Which line ending should files use?
Why does my script fail with "bad interpreter"?
#!/bin/bash\r as the interpreter path, which doesn't exist. Convert to LF.Mixed endings?
What about line endings inside strings?
Git's autocrlf?
core.autocrlf. The tool here is for ad-hoc conversions outside git, or for files git mishandled.Will the tool change the byte count?
Related tools
Last updated: 2025-01-15