Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

Line Ending Converter — CRLF ↔ LF

See which line endings a file uses and convert them — Windows CRLF to Unix LF or back — for pasted text or a whole batch of files, with trailing-space and tab cleanup on the side.

Mis à jour le
Convert to
0
CRLF (Windows)
0
LF (Unix)
0
CR (old Mac)
–
Detected
Drop files to convert in bulk — scripts, configs, CSV, source code · converted files download as a ZIP

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : Line Ending Converter

  1. Paste text or drop one or more files.
  2. Read which line endings were found — mixed files are flagged.
  3. Pick LF or CRLF, optional cleanups, and copy or download the converted text or ZIP.

CRLF vs LF

Text files end each line with an invisible character. Unix, Linux and macOS use LF (\n, line feed). Windows uses CRLF (\r\n, carriage return + line feed). Classic Mac OS used a lone CR. Most editors handle both, but many tools don’t: a shell script with CRLF fails with /bin/bash^M: bad interpreter, Docker entrypoints break, and diffs show every line as changed.

Fixing it for good in Git

Add a .gitattributes file with * text=auto eol=lf (and *.bat text eol=crlf for Windows batch files) so Git normalizes endings on commit. Setting git config --global core.autocrlf input on macOS/Linux and true on Windows also helps. After adding .gitattributes, run git add --renormalize . once.

Mixed line endings

Files edited on different systems often contain both kinds. The counters show exactly how many of each the text contains, and converting makes them uniform.

Private by design

Text and files are converted in your browser and never uploaded.

Aussi recherché comme : crlf to lf, lf to crlf, convert line endings, windows line endings, dos to unix, unix to dos, mixed line endings.

Outils complémentaires : Line Ending Converter

  • Windows Path Converter — Paste a path in any format — C:\Users\me\project, /mnt/c/Users/me/project, /c/Users/me — and get it in every other form, ready to copy: WSL, Git Bash, Cygwin, file URL, UNC and escaped for code.
  • Remove Line Breaks — Paste text with broken lines — from a PDF, an email or a terminal — and join it back into clean paragraphs.
  • .editorconfig Generator — Make every editor on your team use the same indentation, line endings and charset.
  • Générateur de fichiers .gitignore — Cochez les technologies de votre choix — Node, Python, React, Next.js, Docker, macOS, VS Code et 40 autres — et obtenez une liste claire et sans doublons .gitignore avec des sections commentées, prêt à être téléchargé.

Questions fréquentes

How do I fix “bad interpreter: /bin/bash^M”?
The script has Windows (CRLF) line endings. Convert it to LF here — or run sed -i 's/\r$//' script.sh — and save it again.
Which line ending should I use?
LF for almost everything, including code shared across systems and anything that runs on Linux or in Docker. CRLF only for Windows-specific files like .bat and .cmd.
Can I convert many files at once?
Yes. Drop several files — each is converted with your settings and you download them all as a ZIP with the original names.
Puis-je installer Line Ending Converter en tant qu’application web et l’utiliser hors ligne ?
Oui. Line Ending Converter est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires