Convert CRLF ⇄ LF Line Endings
Batch + ZIPConvert CRLF vs. LF line endings locally—fixing broken Bash scripts ($'\r': command not found) and stripping stray UTF-8 BOM bytes.
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#!/usr/bin/env bash\r\nset -euo pipefail\r\necho "Running build"\r\n#!/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.
- Drop files or paste codeLoad .sh scripts, .env files, YAML configs, or source files in single or batch mode.
- Pick LF or CRLFSelect LF for Linux/macOS/Docker scripts or CRLF for Windows tools, plus optional BOM stripping.
- Export clean bytesDownload normalized files ready for CI containers or version control.
Format specs:Plain Text (TXT) (.txt)
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.