Skip to content
Convertto

Line Endings Converter

Convert between CRLF, LF and CR, and strip trailing whitespace.

Line endings differ by platform: Unix and macOS use LF, Windows uses CRLF, and classic Mac OS used a bare CR. Mixed endings in one file break diffs, shell scripts and some parsers. This converter normalises them all and can strip trailing whitespace at the same time.

Runs in your browser
Privacy
Runs entirely in your browser — nothing is uploaded
Cost
Free, unlimited, no sign-up

Frequently asked questions

Why does my shell script fail with a strange error?

Almost certainly CRLF line endings. The shebang line becomes "#!/bin/bash\r", and the interpreter looks for a program whose name ends in a carriage return. Converting to LF fixes it immediately.

How to use the line endings converter

  1. 1Enter or paste your text.
  2. 2Choose the convert to.
  3. 3Choose the trailing whitespace.
  4. 4Turn "Ensure a final newline" on or off as needed.
  5. 5The result appears immediately — copy or download it.

Embed this tool

Put the working line endings converter on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.

Share this tool

Last updated

More developer tools