Open a file
Or paste text. Opening a file keeps its original line endings so they can be counted.
Open a text file to count its real line endings, then download it converted to Windows (CRLF), Unix and macOS (LF) or classic Mac (CR).
100% private — your text is processed in your browser and never sent to any server.
Or paste text. Opening a file keeps its original line endings so they can be counted.
Windows (CRLF), Unix and macOS (LF) or classic Mac (CR).
The download uses the line endings you selected.
A line break is not one thing but three. Windows ends a line with two characters, a carriage return followed by a line feed (CRLF). Linux and modern macOS use a single line feed (LF). Very old Mac systems used a lone carriage return (CR). Most programs cope with all of them, but not all do, and the mismatch produces some familiar symptoms: a script that fails with a mysterious error on Linux, a file that shows as one long line in an old editor, a stray ^M at the end of every line, a diff that marks every line as changed or a checksum that differs between two otherwise identical files.
A text box cannot show you the line endings, because the browser normalises them as soon as you paste. That is why this tool lets you open a file directly. It reads the raw bytes, counts how many CRLF, LF and CR breaks the file contains and shows the totals, so you can see at once whether a file is pure Windows, pure Unix or a mix of both, which is the case that causes the most trouble.
Choose the format you need and press "Download .txt". The file is written with the same line ending on every line, whatever it had before. The text shown in the box is only a preview and uses LF, since the browser cannot display the difference. The download is the file that carries the converted line endings, and it is a plain text file with UTF-8 encoding.
Use LF for anything that will run on Linux or macOS, for source repositories and for web files. Use CRLF for files that Windows programs will read, such as batch scripts or text destined for older Windows software. CR is only needed for very old systems.
The tool treats the file as text. It should not be used for binary files, and it does not change the file encoding, the byte order mark or the last line of the file. Copying the text from the box instead of downloading it will not carry a specific line ending, because the clipboard uses the system default.
More utilities that also run without leaving your browser.