Text tools

Line Ending Converter

Convert LF, CRLF and CR line endings locally.

Source text

Choose a UTF-8 file or paste your text below.

Editor text: the browser normalizes CRLF and CR to LF. Use a file to detect its original endings.

Conversion options

Keep preserves the number of trailing endings. Add inserts one only if missing, including for empty input.

A BOM is an optional encoding marker at the start of a UTF-8 file.

Result

Choose your options, then convert line endings.

Detected line endings in source

LF
CRLF
CR

Counts appear after conversion. CRLF counts once, separately from LF and CR.

⟦LF⟧, ⟦CRLF⟧, ⟦CR⟧ and ⟦BOM⟧ visualize invisible characters. These added markers are never copied or downloaded.

No result yet.

Download preserves exact line-ending bytes. The plain textarea preview normalizes CRLF and CR to LF; your clipboard or receiving application may normalize endings too.

How to use

  1. Add your input

    Paste text or open a UTF-8 file. Original file bytes remain the source until you edit or select Use editor text.

  2. Choose your options

    Choose LF, CRLF or CR, then final newline and BOM rules. Defaults preserve trailing blank lines and the BOM.

  3. Convert and use the result

    Inspect counts and markers, then copy or download. Convert again starts from the same source; Reset clears everything.

Files stay on your device

File reading, decoding and conversion run in your browser. This tool does not upload, log or persist your text or file. Copy and download happen only when you select them.

Common questions

Which characters change?

Only CR (U+000D), LF (U+000A), optional final endings and the first leading BOM (U+FEFF) change. CRLF is one paired ending. Letters, spaces, tabs, emoji, combining marks, Unicode line/paragraph separators and other characters stay unchanged. Removal of trailing endings does not trim spaces.

What do final newline and BOM mean?

Keep converts the existing endings without adding or removing any. Add if missing appends one target ending only if there is no final CR or LF. Remove all trailing endings also removes empty lines at the end. A BOM is the optional UTF-8 prefix EF BB BF: preserve keeps it, add inserts it only when absent, and remove strips the first leading marker. Interior U+FEFF characters remain content.

Why do pasted text and file counts differ?

Browser textareas normalize CRLF and CR to LF. Clipboard software may also normalize before pasting. For original counts, open a UTF-8 file. Editing its displayed text or selecting Use editor text switches to that normalized text. Choose Download UTF-8 when exact bytes matter.

What files and sizes are supported?

Input must be valid UTF-8 regardless of extension or MIME type; malformed bytes produce an error instead of replacement characters. Empty files are valid. Other encodings need conversion to UTF-8 first. There is no fixed size cap; browser memory and string capacity limit processing. Cancel stops processing and preserves your input. This is a plain-text tool, not a rich-document converter.