Newline Converter
Detect a file's line-ending style and convert between Unix (LF), Windows (CRLF), and classic Mac (CR) formats without touching any other character.
Output Format
Common Use Cases
About Newline Converter
Every plain text file ends each line with one or more invisible control characters, and which ones it uses depends on the operating system that created it. Unix, Linux, and modern macOS use a single line feed character (LF, \n). Windows uses a carriage return followed by a line feed (CRLF, \r\n), a convention inherited from old teletype hardware where the carriage genuinely had to return to the left margin before advancing to the next line. Classic Mac OS, before OS X, used a lone carriage return (CR, \r) with no line feed at all. All three conventions look identical on screen as an ordinary line break, so a text editor rarely tells you which one a given file is actually using.
That invisibility is exactly what makes mismatched line endings such a persistent source of trouble. A shell script saved with Windows-style CRLF endings and then run on Linux or inside a Docker container fails with a cryptic "bad interpreter" error, because the shebang line's interpreter path ends in an invisible \r that the kernel treats as part of the filename. A file re-saved by an editor that silently normalizes line endings shows every single line as changed in a git diff, burying the one real edit under thousands of false ones and making code review effectively useless. Some parsers, CSV importers, and older APIs choke outright on line endings they don't expect, or silently split records in the wrong place. A file assembled by copying sections from multiple sources can end up with two or even three line-ending styles mixed together, which is often the hardest version of this problem to notice by eye.
This tool solves both halves of that problem: it tells you what you're looking at, and then it fixes it. Paste or type text into the input panel, and it's scanned immediately, counting exactly how many CRLF pairs, lone LF characters, and lone CR characters are present. A badge next to the Input label reports the result in plain language: Unix (LF) detected, Windows (CRLF) detected, Classic Mac (CR) detected, Mixed line endings when more than one style is present in the same text, or No line breaks when the text is a single line. A row of stats beneath the panels breaks the same counts out individually, so a file with mixed endings shows exactly how many of each type it contains rather than only flagging that a mix exists. Pick a target format with the Unix, Windows, or Classic Mac segmented control above the input, and the output panel updates instantly, with a one-click copy button to grab the result.
The conversion itself only ever touches line-ending characters. Every CRLF pair and every lone CR is first normalized down to a plain LF, and that normalized text is then expanded into whatever target format you chose, so mixed input converts just as cleanly as input that's already consistent. No word, space, tab, or any other character in your text is inspected, reordered, or altered in the process, and nothing you paste here is ever uploaded, logged, or transmitted anywhere. Every character is scanned and every conversion performed by plain JavaScript running directly in your browser, which matters because the files people run this on, scripts, configuration files, source code, are often exactly the kind of thing that shouldn't leave their machine.