Change line endings

Convert text files between Windows (CRLF) and Unix or macOS (LF) line endings, several at a time.

or drop them here · files stay on your device
We count formats and sizes. Filenames stay private unless you opt in.

Convert to
Processed on this device
  • Runs on your device
  • No sign-up or watermark
  • No fixed file size cap

The short answer

To convert CRLF to LF, choose one or more text files, set Convert to LF (Unix, macOS) and run it. Every line break, including mixed ones and old Mac CR, is normalised first, then written in the style you picked. It runs in your browser, so nothing is uploaded. Choose CRLF for the reverse.

How to convert Windows line endings to Unix

  1. STEP 1

    Choose text files

    Select one or more .txt, .csv, .json, .md or other text files. They are read on your device.

  2. STEP 2

    Pick the target

    In Convert to, choose LF (Unix, macOS) or CRLF (Windows).

  3. STEP 3

    Convert line endings

    The report shows how many files changed; files already in that style are listed as unchanged.

  4. STEP 4

    Download the files

    Each file saves as name-eol with its own extension. Several come back together in a ZIP.

CRLF, LF and why they cause trouble

Text files end each line with an invisible marker. Windows uses two characters, carriage return and line feed (CRLF, \r\n). Linux and modern macOS use a line feed alone (LF, \n). Classic Mac OS used a carriage return alone (CR).

Mixing them causes real faults: shell scripts with CRLF fail with "bad interpreter" errors on Linux, git diffs show every line as changed, and some CSV importers see blank rows. Normalising the endings fixes all of these without touching the text itself.

What survives, and what does not

Each file is read as UTF-8 text. Every CRLF, lone CR and LF is first turned into LF, so files with mixed endings are cleaned in one pass, and then converted to CRLF if you chose Windows. The report counts how many files actually changed. Outputs keep their original extension with -eol added to the name.

What you keep

Every character of text, only line breaks change

The file extension, so a .csv stays a .csv

Files with mixed endings, normalised to one style

What you lose

There is no option to write classic Mac CR endings; CR input is read but output is LF or CRLF

A UTF-8 byte order mark at the start of the file is dropped

Files in encodings other than UTF-8, such as Windows-1252, can have accented characters damaged

Honest limits are published on every tool page. If a tool cannot do something well, it says so here rather than letting you find out after the download.

Change line endings at a glance

InputText files: TXT, CSV, JSON, MD and other text/* types
OutputSame format, with LF or CRLF endings
ReadsCRLF, LF, CR and mixed
BatchYes, several files at once
Runs onYour device, in the browser
Works offlineAfter the first use

If something goes wrong

It says the file looks like a binary file

The tool found a NUL byte, which plain text does not contain. Word documents, spreadsheets and UTF-16 files are not plain UTF-8 text; save them as UTF-8 text first.

It reports 0 files changed

The files already use the endings you picked. Nothing is wrong; you can use the originals as they are.

My shell script still fails after converting

Check that you chose LF, and that your editor is not converting back on save. A .gitattributes rule such as *.sh text eol=lf keeps git from doing it either.

Change line endings questions

How do I convert CRLF to LF?

Choose the files, set Convert to LF (Unix, macOS) and run it. Every Windows line break becomes a single line feed.

How do I convert LF to CRLF for Windows?

Pick CRLF (Windows) instead. Use it for batch files or tools such as older Notepad versions that expect Windows endings.

What does the bad interpreter error with ^M mean?

The script was saved with CRLF endings, so Linux reads the carriage return as part of the interpreter path. Converting the script to LF fixes it.

Can I fix line endings without installing dos2unix?

Yes. This does the same job in a browser on Windows, macOS or Linux, for several files at once, with nothing to install.

Does it handle files with mixed line endings?

Yes. All CRLF, CR and LF breaks are normalised first, so a file with a mix ends up consistent.

Are my files uploaded?

No. They are read and rewritten in your browser tab, then saved back to your device.

One of 153 file tools and planned additions. Built and tested by Arin Prajapati, last checked against the code on . canonical: https://damnfiles.com/line-endings
Analytics preferences

Help us understand which tools and file types people use. File contents always stay on your device.

Filename sharing is optional and off by default. Names can contain personal information. Changes apply to future events; disabling sharing does not delete earlier records.

Read our privacy policy