1. Home
  2. Writing & text tools
  3. Line Ending Converter (CRLF ⇄ LF)

Line Ending Converter (CRLF ⇄ LF)

Fix “^M” characters in a shell script, a Git diff full of whitespace changes, or a CSV that an old Windows program will not read — without installing dos2unix.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Line Ending Converter (CRLF ⇄ LF)

  1. Choose LF, CRLF or CR.
  2. Drop one or more text files.
  3. Download each file or all of them as a ZIP.

Features

  • LF, CRLF and CR, in any direction, with mixed endings normalised
  • Works on bytes: encoding and BOM preserved, UTF-16 handled
  • Current line endings and final newline shown per file
  • Optional final newline
  • Many files at once, downloaded as a ZIP

Supported formats

You can open

  • TXT
  • CSV
  • Any file

You get

  • TXT
  • ZIP

Private by design

Your files are opened and processed by your browser on this device. They are never uploaded to openWorkstand or anyone else, so the Line Ending Converter (CRLF ⇄ LF) is safe for contracts, IDs, photos and work documents. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • UTF-8, ASCII, single-byte and UTF-16 files with a byte order mark are supported; UTF-16 without a BOM is treated as bytes.

Guide

Converting line endings between CRLF, LF and CR

Text files end each line with an invisible marker, and operating systems disagree about which. Windows uses two characters, carriage return plus line feed (CRLF). Linux, macOS and almost every programming tool use a single line feed (LF). Classic Mac OS used a lone carriage return (CR). Files moving between systems carry the wrong endings with them, and things break in confusing ways. This converter rewrites the line endings of any number of text files, in your browser, without touching anything else.

Symptoms of wrong line endings

A shell script copied from Windows fails on Linux with “bad interpreter” or “$‘\r’: command not found”, because each line ends with an extra carriage return. Editors show ^M at line ends. Git diffs show every line changed after someone edited a file on another system. Some Windows programs show an LF-only file as one long line, and CSV importers split rows wrongly. Converting the endings fixes all of these.

How it works

Drop one or more files. For each, the table shows its size, how many CRLF, LF and CR line endings it contains, whether it ends with a newline and its encoding. Choose the target — LF, CRLF or CR — and download. Mixed files are normalised, so every line ends the same way afterwards.

Only the line breaks change

The conversion works directly on the file’s bytes. Line-break bytes are rewritten; every other byte, including accented letters in UTF-8, special characters in older single-byte encodings and the byte order mark, is copied exactly. Files in UTF-16 with a byte order mark are processed character by character, so they stay valid UTF-16. Your file is never decoded and re-encoded, which is what makes this safe for source code and data.

Final newline

Many tools expect a text file to end with a line break; Git marks files without one as “No newline at end of file”, and POSIX defines a line as ending with a newline. With “End every file with a line break” on, a missing final newline is added. Files that already end with one are not given a second.

Many files at once

Drop a whole folder’s worth of files. Download them one by one, or press “Download all” to get a ZIP with every converted file under its original name. Converted files are new downloads; your originals stay as they were until you replace them.

Preventing it in Git

For a repository, add a .gitattributes file with a line such as * text=auto eol=lf, so Git normalises line endings on commit and checks them out consistently. Use this converter for one-off files, uploads to servers and systems that need a specific ending.

A worked example

A deploy.sh written on Windows shows “CRLF 42” and fails on the server. Converting to LF with the final newline option gives a file that shows “LF 42”, has exactly 42 fewer bytes, and runs.

See every whitespace character and line ending in the Whitespace Visualizer, fix CSV character encoding with Fix CSV Encoding, clean pasted text with the Text Cleaner, or compare file versions with the Diff Checker.

Checked against the current version of the Line Ending Converter (CRLF ⇄ LF) on .

Troubleshooting

The file does not open

Check that it is one of the supported formats above and opens in another app. Damaged files and password-protected PDFs cannot be read until they are repaired or unlocked.

It is slow or stops on a very large file

Everything runs on your device, so speed depends on its memory. Close other tabs, use a computer rather than a phone, or split the file into smaller parts first.

The download did not start

Look for your browser’s download bar or icon. Some browsers ask once before a site may download files; allow it and click the button again.

Frequently asked questions

Is this the same as dos2unix?

For line endings, yes: converting to LF does what dos2unix does, and converting to CRLF matches unix2dos. It runs in the browser, so it also works on locked-down computers where you cannot install tools.

Will converting change my file’s encoding?

No. Only the bytes of line breaks are rewritten; every other byte, including accented letters and a UTF-8 byte order mark, is copied exactly. UTF-16 files with a byte order mark are handled character by character.

Do binary files get damaged?

Binary files such as images or ZIPs contain bytes that look like line breaks, and converting them would corrupt them. Only drop text files: source code, scripts, CSV, configuration and plain text.

Why does my script fail with “bad interpreter” or show ^M?

The file has Windows CRLF line endings, so Linux sees an extra carriage return at the end of every line, including the #! line. Converting to LF fixes it.

Should I fix line endings in Git instead?

For a repository, yes: a .gitattributes file with text=auto or eol=lf stops the problem recurring. This tool is for one-off files and for systems that need a specific ending.

Keep working with the result

After you download, choose “Save to Workstand” to keep the result in a folder on your computer, attach it to a project and create a follow-up task. It is saved by your browser, not uploaded.