Texto
CRLF ↔ LF Converter
Convierte los finales de línea entre Windows (CRLF), Unix/macOS (LF) y el Mac clásico (CR), con detección de finales mixtos.
El navegador normaliza a LF el texto pegado en el campo, por lo que aquí no se pueden detectar los CRLF/CR originales — para analizar o convertir un archivo con CRLF/CR reales, usa la carga de archivo de arriba.
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.
Preguntas frecuentes
¿Por qué difieren los finales de línea según el sistema?
Windows usa CRLF (\r\n), Unix y macOS usan solo LF (\n), y el Mac clásico usaba solo CR (\r) — estas diferentes convenciones históricas causan inconsistencias cuando un archivo se mueve entre sistemas.
¿Por qué necesito subir un archivo en lugar de pegar texto?
El navegador normaliza automáticamente a LF cualquier texto pegado en un campo de entrada, así que los caracteres CRLF o CR originales reales se vuelven indetectables una vez pegados — solo subir el archivo directamente conserva sus finales de línea reales para análisis o conversión.
¿Cuándo importa realmente este tipo de problema?
Importa sobre todo con git (diffs ruidosos causados por finales de línea), scripts de shell que fallan por CRLF residuales, y archivos intercambiados entre sistemas Windows y Unix/macOS; el archivo subido solo se procesa localmente en el navegador, nunca se envía a un servidor.
¿Qué hacer si un archivo tiene CRLF y LF mezclados?
Un archivo editado en varios editores o en distintos sistemas operativos puede contener ambos estilos a la vez. La conversión debe aplicarse a todo el archivo, no solo a las líneas visiblemente «sospechosas» — de lo contrario, parte de los finales problemáticos pasará desapercibida.
¿Se puede automatizar la conversión mediante git?
Sí, la opción core.autocrlf de git convierte automáticamente los finales de línea al hacer checkout y commit, y .gitattributes permite fijar explícitamente el estilo de finales para tipos de archivo concretos del repositorio.