텍스트
CRLF ↔ LF Converter
Windows(CRLF), Unix/macOS(LF), 클래식 Mac(CR) 간에 줄바꿈 문자를 변환하며, 혼합된 줄바꿈도 감지합니다.
브라우저가 입력란에 붙여넣은 텍스트를 자동으로 LF로 정규화하기 때문에 원본 CRLF/CR을 여기서 감지할 수 없습니다 — 실제 CRLF/CR이 포함된 파일을 분석하거나 변환하려면 위의 파일 업로드를 사용하세요.
Windows, Unix/macOS, and the old classic Mac historically use different characters to mark the end of a line — CRLF, LF, and CR respectively. Mixing these styles in one file often causes odd artifacts in diffs or editors. This tool converts line endings to one style and detects mixed ones.
How to use it
- Paste text and the tool automatically detects the current line-ending style, including a mixed one.
- Pick a target format (CRLF, LF, or CR) and the conversion happens instantly.
- If several styles are found in the same file, that's flagged with a separate warning.
Common uses
- Fixing a file where git diff shows every line as changed because of differing line endings, even though the content itself didn't actually change.
- Converting a text file to the format a specific system or script expects (a Unix script, for instance, expects LF).
- Debugging why a file opened in a Windows editor shows the entire text on one line (a sign of plain LF with no CR).
Things to keep in mind
Git can automate this conversion itself through core.autocrlf or .gitattributes — often more convenient than converting files in a repository by hand.
Mixed line endings in one file aren't always visible at a glance, but they can break parsers or scripts that expect one specific style.
자주 묻는 질문
CRLF, LF, CR은 왜 서로 다른가요?
Windows는 전통적으로 캐리지 리턴과 줄바꿈을 함께 쓰는 CRLF(\r\n)를, Unix 계열과 macOS는 LF(\n)만을, 구형 클래식 Mac은 CR(\r)만을 줄바꿈 문자로 사용해 왔기 때문입니다.
입력란에 붙여넣어도 원본 줄바꿈이 그대로 유지되나요?
아니요. 브라우저는 텍스트 입력란에 붙여넣은 내용을 자동으로 LF로 정규화하기 때문에 원본이 CRLF였는지 CR이었는지는 붙여넣기만으로는 알 수 없습니다. 실제 줄바꿈을 정확히 감지하거나 변환하려면 파일 업로드 기능을 사용해야 합니다.
줄바꿈 차이는 언제 문제가 되나요?
git이 줄바꿈을 변경 사항으로 인식하거나, 셸 스크립트가 CRLF 때문에 실행에 실패하거나, 여러 운영체제를 오가며 작업하는 파일에서 흔히 문제가 됩니다. 이 도구의 처리는 모두 브라우저 안에서 이루어지며 파일은 서버로 전송되지 않습니다.
한 파일 안에 CRLF와 LF가 섞여 있으면 어떻게 해야 하나요?
여러 에디터나 서로 다른 OS에서 편집된 파일에는 두 스타일이 동시에 섞여 있을 수 있습니다. 변환은 눈에 띄게 "의심스러운" 줄만이 아니라 파일 전체에 적용해야 합니다 — 그렇지 않으면 일부 문제 있는 줄바꿈이 눈에 띄지 않게 남을 수 있습니다.
git을 통해 변환을 자동화할 수 있나요?
네, git의 core.autocrlf 설정은 checkout과 commit 시 줄바꿈을 자동으로 변환하며, .gitattributes를 사용하면 저장소 안의 특정 파일 유형에 대해 줄바꿈 스타일을 명시적으로 지정할 수 있습니다.