Line ending converter
Convert LF, CRLF, or CR line endings and download exact UTF-8 text.
Open a file to preserve original endings. Pasting or editing can normalize them to LF.
LF: Unix, Linux, and modern macOS. Blank lines and the presence or absence of a final newline stay unchanged. Download keeps exact UTF-8 bytes; copying from the preview may change line endings. Unicode NEL, line separator, and paragraph separator stay unchanged.
Result
Start typing and the result appears here. No button needed.
Line ending converter, without the extra steps.
Make a text file use one consistent line-ending style without joining its lines or trimming its contents. Open a UTF-8 file to inspect the original LF, CRLF, and CR counts, choose the format your receiving application needs, and download the converted text. The original and result remain readable in the workspace while the counters reveal changes that ordinary text cannot show.
How to use this tool
- 1Open a UTF-8 text file, or paste text if its original line-ending style does not matter. Inspect the input counts.
- 2Choose LF for Unix-style endings, CRLF for Windows-style endings, or CR for a legacy format. The preview updates automatically.
- 3Check the output counts and download the TXT file. Downloading preserves the exact converted bytes.
When Line ending converter is the right tool
- A Windows-generated text file needs LF endings before it is used by a Unix-oriented workflow.
- A receiving application explicitly requires CRLF, while your editor produced a file containing only LF.
- A file assembled from several sources contains mixed line endings that you want to make consistent without changing its words.
- A legacy import requires CR separators, and copying through a browser clipboard would lose the exact format.
A line break can be one byte or two
LF is the byte 0A, CR is 0D, and CRLF is the two-byte sequence 0D 0A. A CRLF pair represents one line break, so this converter matches the pair before considering either character separately. That avoids accidentally doubling your lines. Switching one LF to CRLF adds one byte without changing the words. The input and output counts distinguish these otherwise invisible formats, and the download encodes the result as UTF-8 without platform-specific newline rewriting.
Keep the structure of the original file
Converting line endings is a format change, not a cleanup of blank lines or indentation. Consecutive breaks remain consecutive, leading spaces remain leading spaces, and a missing final newline stays missing. A final newline that already exists is converted like any other break. Unicode NEL, line separator, and paragraph separator characters are left alone because some documents assign them a different meaning. Use the whitespace visualizer to inspect those characters before choosing a separate cleanup operation.
Encoding is separate from line-ending style
Opening a file uses strict UTF-8 decoding, so invalid bytes produce an explanation instead of replacement characters that could corrupt names or identifiers. An existing UTF-8 byte-order mark is preserved; one is never added automatically. UTF-16 and binary data containing NUL characters are rejected. Changing CRLF to LF does not convert a legacy character encoding. Save such a file as UTF-8 in an editor first, then use this tool for its newline convention.
A few quick answers.
Choose the style required by the program receiving your file. LF is customary on Unix, Linux, and modern macOS. CRLF uses a carriage return followed by a line feed and is customary in Windows text files. CR is a legacy convention. Many modern editors accept more than one style, so follow the receiving system's explicit requirement when there is one.
A browser textarea can turn CRLF and CR into LF before the tool sees pasted or edited text. Opening a UTF-8 file reads its original characters directly, allowing accurate input counts and conversion. The readable preview can look identical in all three modes; the counts and downloaded bytes show the difference.
No. The selected file is read and converted locally in your browser. Download creates a new file on your device and leaves the original untouched. The output uses the name converted-lf.txt, converted-crlf.txt, or converted-cr.txt so the selected format is clear.
Browsers display line breaks as layout rather than visible byte values. The output counters show whether the file now contains LF, CRLF, or CR, and the downloaded TXT contains those exact bytes. Copying text from the preview may let your browser or operating system normalize the endings again.
Yes. A single-line file remains unchanged and reports that no ending changes were needed. An imported empty file produces an empty download. Conversion does not append a final newline, invent blank lines, or add a byte-order mark.
No. The tool only replaces CRLF, CR, and LF sequences. It does not set executable permissions, parse CSV records, repair quoting, or distinguish a newline inside a quoted field from a record separator. Review your format's requirements before converting structured files.