Line Ending DetectorDetect and count line ending types (CRLF, LF, CR) in text files.

Line Ending Detector
Detect and count line ending types (CRLF, LF, CR) in text files.
Paste text
Paste the text content you want to analyze.
Analyze
Click Analyze to detect and count line ending types.
View results
See counts for CRLF, LF, and CR with recommendations.
What Is Line Ending Detector?
Line Ending Detector analyzes text to identify and count the types of line endings used. Different operating systems use different line ending conventions: Windows uses CRLF (\r\n), Unix/Linux/macOS uses LF (\n), and classic Mac OS used CR (\r). Mixed line endings can cause issues in version control, text editors, and scripts. This tool counts each type, identifies the dominant convention, detects mixed endings, and provides a recommendation for normalization.
Why Use Our Line Ending Detector?
- Counts all three line ending types: CRLF, LF, and CR.
- Detects mixed line endings that can cause compatibility issues.
- Identifies the dominant line ending convention.
- Provides normalization recommendations.
Common Use Cases
Git Issues
Diagnose line ending conflicts in Git repositories, especially cross-platform projects.
Script Debugging
Debug shell scripts that fail on Windows or batch scripts that fail on Linux due to line endings.
Code Review
Verify consistent line endings across source code files.
File Comparison
Understand why files appear different in diff tools due to line ending differences.
Technical Guide
The detector scans the input text character by character. It recognizes three line ending patterns: - CRLF (\r\n): Two-character sequence, counted as one line ending. The \n after \r is consumed to prevent double-counting. - LF (\n): Single character, counted only when not preceded by \r. - CR (\r): Single character, counted only when not followed by \n. Mixed endings are flagged when more than one type is present. The dominant type is determined by comparing counts. The total line count is the sum of all line endings plus one (for the last line). Recommendation logic: If mixed endings are detected, the tool recommends normalizing to the more common type (CRLF for Windows-heavy codebases, LF for Unix-heavy codebases).
Tips & Best Practices
- 1Mixed line endings are a common source of Git diff noise — normalize before committing.
- 2Most modern editors (VS Code, Sublime) can convert line endings via status bar settings.
- 3Git's core.autocrlf setting can help manage line endings across platforms.
- 4Unix/macOS uses LF, Windows uses CRLF — choose one standard for your project.
Related Tools

BOM Detector/Remover
Detect and remove Byte Order Marks (BOM) from text files.

Encoding Detector
Detect text file character encoding (UTF-8, UTF-16, ASCII, Latin-1).

File Metadata Viewer
View comprehensive file metadata including size, type, entropy, and hex header.

File Format Identifier
Detect file format by analyzing magic bytes (file signature) in the header.

CSV to JSON
Convert CSV data to JSON array format instantly in your browser.

JSON to CSV
Convert JSON arrays to CSV format with proper escaping and formatting.
Frequently Asked Questions
QWhat is the difference between CRLF and LF?
QWhy do mixed line endings cause problems?
QHow can I fix mixed line endings?
QWhat about CR line endings?
QDoes Git handle line endings?
About Line Ending Detector
Line Ending Detector 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.







