Skip to main content
SiteIndex
实用工具可以使用

转换 LF、CRLF 和 CR 换行符

在浏览器中将文本转换为 Unix、Windows 和 Mac 使用的换行格式。

使用指南

交互式工具区

无需注册账号
换行符转换器

Detected: 2 CRLF, 0 LF, 0 CR

3 lines · 2 line endings · 2 will change to LF

Which line ending should you use?
StyleBytesUsed by
CRLF (\r\n)2Windows / DOS, most Windows editors, CSV opened in Excel
LF (\n)1Unix, Linux, macOS, Git repositories, shell scripts
CR (\r)1Classic Mac OS (pre-OS X); rarely used today

Git settings

On Windows, git config --global core.autocrlf true converts LF to CRLF on checkout and back on commit. On macOS/Linux use core.autocrlf input (convert CRLF to LF on commit only). A committed .gitattributes file overrides per-machine settings:

* text=auto eol=lf
*.sh text eol=lf
*.bat text eol=crlf

A shell script saved with CRLF endings fails on Linux with $'\r': command not found — convert scripts to LF before running them.

换行符转换器是什么?

在浏览器中将文本转换为 Unix、Windows 和 Mac 使用的换行格式。

工作原理

在浏览器中将文本转换为 Unix、Windows 和 Mac 使用的换行格式。

常见用途

在浏览器中将文本转换为 Unix、Windows 和 Mac 使用的换行格式。

使用限制

结果可能因浏览器、网络、输入内容和外部服务而异。本工具仅供参考,不能替代专业诊断或建议。

常见问题
换行符转换器是什么?
在浏览器中将文本转换为 Unix、Windows 和 Mac 使用的换行格式。

相关工具