Newline Converter

Convert line endings between LF, CRLF, and CR.

Text

The Newline Converter normalizes line endings across different operating systems. Line ending inconsistencies are a common source of frustration when moving files between Windows, macOS, and Linux — or when collaborating with teammates who use different platforms. Windows uses CRLF (carriage return + line feed), Unix-based systems use LF (line feed), and older Macs used CR (carriage return). This tool lets you paste any text and convert all line breaks to your chosen format in one click. Everything runs client-side in your browser, so your content stays private and is never uploaded to any server.

About Newline Converter

Different operating systems use different characters to mark the end of a line in text files. LF (\n) is used on Linux and modern macOS, CRLF (\r\n) on Windows, and CR (\r) on classic Mac OS. When a file contains mixed line endings, editors may display extra blank lines, version control diffs become noisy, and build scripts can fail silently. This tool normalizes your text to a single, consistent line ending format so it behaves correctly wherever it is opened.

How to Use Newline Converter

  1. Paste your text into the input area. The text may contain any mix of LF, CRLF, or CR line endings.
  2. Select the target format — LF, CRLF, or CR — from the dropdown.
  3. Click Convert line endings. The result appears with all line breaks replaced by your chosen format.
  4. Copy the result and paste it back into your file, editor, or code repository.

Key Features

  • Converts between all three standard line ending formats: LF, CRLF, and CR
  • Handles mixed line endings in a single pass
  • Preserves all other content — only line break characters are changed
  • Browser-based processing with no file uploads or server interaction
  • Useful for developers, writers, and system administrators working cross-platform

When to Use This Tool

  • Moving text files between Windows and Linux/macOS environments
  • Cleaning up source code before committing to Git to avoid line-ending noise in diffs
  • Fixing configuration files that display incorrectly after transfer between systems
  • Preparing CSV or log files for tools that expect a specific line ending format
  • Collaborating on shared documents where team members use different operating systems

Technical Details

The converter uses a regular expression that matches \r\n, \r, or \n and replaces each occurrence with the selected line ending character(s). This approach handles mixed endings reliably. No character encoding conversion takes place — only the line break bytes are changed, leaving UTF-8 or other encodings intact. For additional text cleanup, try the Remove Line Breaks tool or the Text Trim utility.

Conclusion

Line ending mismatches are a subtle but common problem in cross-platform development and file sharing. This free, browser-based Newline Converter quickly standardizes your text to LF, CRLF, or CR — keeping your files clean, your diffs readable, and your scripts running smoothly.

Frequently Asked Questions

What are LF, CRLF, and CR?
LF (\n) is used on Linux and Mac. CRLF (\r\n) is used on Windows. CR (\r) is the older Mac standard. Converting ensures files work consistently across all systems.
Will this change my file encoding?
No. Only line ending characters are replaced. Character encoding (UTF-8, ASCII, etc.) is not affected.
Can I use this to fix Git line ending issues?
Yes. If your Git diffs show every line as changed due to mixed line endings, convert the file to LF (the Git and Unix standard) and recommit. You can also configure Git's core.autocrlf setting for automatic conversion.
Is my text sent to a server?
No. Conversion runs entirely in your browser. Your content never leaves your device.