Nekonote Toolbox logo

Nekonote Toolbox

Free browser-based tools for developers and IT admins.

日本語

Line Ending Converter (LF, CRLF, CR)

Files are read as UTF-8 text, up to 20 MB. Do not use binary files.

Line endings found
Convert to

Line endings made visible (first 12 lines of the result)


                

About this tool

Text files end each line with a hidden code: LF on Linux and macOS, CRLF on Windows, and CR on very old Mac systems. A file with the wrong one can break shell scripts, show ^M characters, or make every line look changed in version control. Paste your text or open a file, see which endings it has, and convert them all to one.

Everything runs in your browser. Your text and files are never sent to a server.

How it works

  • The counts show how many lines end with LF, CRLF and CR. "Mixed" means more than one kind is present, which is a common cause of odd diffs.
  • Converting turns every kind of ending into the one you choose, so mixed files become consistent.
  • Remove trailing spaces and tabs strips invisible whitespace at the end of each line. End with exactly one line break removes extra blank lines at the end and makes sure there is one final line break, as POSIX tools and most style guides expect.
  • Browsers normalize line breaks in a text box to LF while you edit, so pasted Windows text may be reported as LF even though it was CRLF at the source. Opening the file with the file button keeps the original endings in the count.
  • The download is always UTF-8 without a byte order mark. For other encodings such as Shift_JIS or UTF-16, use a text editor.

FAQ

Q. Which ending should I pick?

A. Use LF for almost everything: source code, Linux and macOS files, shell scripts, and Git repositories. Use CRLF for files that must be read by Windows-only tools, such as old versions of Notepad or some batch workflows. Git can convert for you with core.autocrlf.

Q. My shell script fails with "bad interpreter: /bin/bash^M".

A. The file has Windows line endings. Convert it to LF here and save it again.