# 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.

**URL:** https://convertto.tech/t/line-endings-converter
**Category:** Developer Tools (https://convertto.tech/c/developer-tools)
**Privacy:** Runs entirely in the browser; no upload
**Cost:** Free, no sign-up
**Last updated:** 2026-08-01

## Key facts

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

## How to use

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

## FAQ

### 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.

## Related tools

- [Unified Diff & Patch Generator](https://convertto.tech/t/diff-to-patch): Produce a unified diff between two texts that git apply and patch can consume.
- [Git Command Builder](https://convertto.tech/t/git-command-builder): Build the exact git command for fifteen common tasks, with explanations and safety notes.
- [.gitignore Generator](https://convertto.tech/t/gitignore-generator): Build a .gitignore file for your stack, with the entries people usually forget.
- [Unix Timestamp Converter](https://convertto.tech/t/timestamp-converter): Convert Unix timestamps to human dates and back, in seconds or milliseconds.
- [7Z to ZIP Converter](https://convertto.tech/t/7z-to-zip): Convert 7-Zip (.7z) archives into universal ZIP format.
- [API Request Builder](https://convertto.tech/t/api-request-builder): Build an HTTP request visually and get it as curl, fetch, axios, Python, Go or PHP code.
- [Naming Convention Converter](https://convertto.tech/t/case-detector): Convert an identifier between every common naming convention at once.
- [Code Comment Remover](https://convertto.tech/t/comment-remover): Strip comments from six language families without breaking string literals.
