Free Toolkit

Line Ending ConverterConvert between line endings: LF (Unix), CRLF (Windows), CR (Classic Mac).

Line Ending Converter illustration
📝

Line Ending Converter

Convert between line endings: LF (Unix), CRLF (Windows), CR (Classic Mac).

How to Use
1

Paste Text

Paste text with line endings to convert.

2

Select Target

Choose the target line ending: LF, CRLF, or CR.

3

Copy Result

Copy the text with converted line endings.

What Is Line Ending Converter?

The Line Ending Converter changes the line break characters in text between the three major formats: LF (\n, used by Unix/Linux/modern macOS), CRLF (\r\n, used by Windows), and CR (\r, used by Classic Mac OS). It first normalizes all line endings to LF, then converts to the selected target format. This resolves common issues when moving text or code between operating systems.

Why Use Our Line Ending Converter?

  • Fix line ending issues when moving files between OS platforms
  • Standardize line endings for cross-platform projects
  • Convert Windows CRLF to Unix LF or vice versa
  • Resolve Git and version control line ending conflicts

Common Use Cases

Cross-platform Development

Normalize line endings when collaborating across Windows, Mac, and Linux.

Git Issues

Fix line ending conflicts in version-controlled files.

File Transfer

Convert line endings after transferring files between operating systems.

Script Compatibility

Ensure shell scripts use LF line endings for Unix compatibility.

Technical Guide

The converter uses a two-step process. First, all line endings are normalized to LF (\n) by replacing CRLF (\r\n) first, then replacing any remaining CR (\r). CRLF must be replaced first to prevent creating double LF. After normalization, the tool converts LF to the target format: for CRLF, LF becomes \r\n; for CR, LF becomes \r; for LF, no further conversion is needed. This approach handles mixed line endings in the input correctly, producing consistent output regardless of the input format.

Tips & Best Practices

  • 1
    LF (\n) is the standard for Unix, Linux, and modern macOS
  • 2
    CRLF (\r\n) is the standard for Windows
  • 3
    CR (\r) was used by Classic Mac OS 9 and earlier
  • 4
    Most modern editors handle both LF and CRLF, but scripts may require specific endings

Related Tools

Frequently Asked Questions

QWhat is the difference between LF and CRLF?
LF (Line Feed, \n) is one character. CRLF (Carriage Return + Line Feed, \r\n) is two characters. They serve the same purpose on different OS.
QWhich format should I use?
Use LF for Unix/Mac/modern systems. Use CRLF for Windows-specific applications. Most modern software handles both.
QCan it handle mixed line endings?
Yes, all line endings are normalized first, then converted to the target format.
QWill the output look the same?
Visually the text looks identical. The change is in the invisible line break characters.
QHow do I know which line endings my text has?
Use the Whitespace Visualizer tool to see line ending characters marked with ↵ (LF), ¶ (CRLF), or ← (CR).

About Line Ending Converter

Line Ending Converter is a free online tool from FreeToolkit.ai. All processing happens directly in your browser — your data never leaves your device. No registration required. No ads. Just fast, reliable tools.