Convert CRLF ⇄ LF Line Endings

Batch + ZIP

Convert CRLF vs. LF line endings locally—fixing broken Bash scripts ($'\r': command not found) and stripping stray UTF-8 BOM bytes.

100% Client-Side — Verify 0 bytes uploaded in Network tabVerify 0 bytes sent in Network tab

or drop files here · Ctrl V to paste · or drop .sh, .txt, .csv, .yml, .env, .py, .js
  • 100% browser-local
  • Fixes $'\r' Bash errors
  • Optional BOM stripping

Instant Before & After Preview

BOM stripped + LF
Before (Input)deploy.sh
#!/usr/bin/env bash\r\nset -euo pipefail\r\necho "Running build"\r\n
After (Output).txt
#!/usr/bin/env bash
set -euo pipefail
echo "Running build"

How it works

How to convert CRLF and LF line endings

Eliminate invisible carriage returns (\r) from shell scripts and source files—or add CRLF when targeting Windows tools.

  1. Drop files or paste codeLoad .sh scripts, .env files, YAML configs, or source files in single or batch mode.
  2. Pick LF or CRLFSelect LF for Linux/macOS/Docker scripts or CRLF for Windows tools, plus optional BOM stripping.
  3. Export clean bytesDownload normalized files ready for CI containers or version control.

FAQ

Frequently asked questions

Why does a shell script edited on Windows fail with syntax error near unexpected token $'\r'?

Windows writes \r\n (CRLF) line endings, and Linux Bash treats the extra \r carriage return as part of commands or shebang paths. Converting to LF fixes it immediately.

Should Strip BOM stay on when normalizing Unix scripts or JSON?

Yes. Linux shells, jq, and many CLI parsers reject a leading EF BB BF UTF-8 BOM on #!/bin/bash shebang lines.

Can I convert back from LF to CRLF?

Yes. Choose CRLF (Windows / Excel) under Target Line Ending to normalize Unix files for Windows.