Skip to content

Formatters & Code

Line Break Converter

Convert between LF, CRLF, CR, <br>, comma and more.

Runs in your browser
Input · source
lines: 0chars: 0size: 0 B
Converted · result
lines: 0chars: 0size: 0 B
live

Understanding line break converters

Three OS conventions, one invisible character.

The thing that ends a line is different on every operating system, and most of the time you don't notice.

LF, CRLF, CR.

Unix and macOS use a single \n (line feed) to end a line. Windows uses \r\n (carriage return + line feed) — a holdover from typewriters and teletype machines, where carriage return moved the carriage left and line feed advanced the paper. Classic Mac OS (System 9 and earlier) used a lone \r, which you almost never see today but might find in a really old file.

When the difference bites.

Most tools are forgiving — modern editors, browsers, and languages handle all three transparently. The places it shows up are: a Git commit on Windows checked out on Mac and the diff explodes; a CSV file from a Windows machine opened in a Unix tool that splits on \n and leaves stray \r at the end of each field; a shell script with CRLF endings that fails because the shebang line ends with \r.

HTML and CSV — special separators.

HTML uses <br> rather than a literal newline; CSV uses commas (with embedded newlines inside quoted fields). The converter understands all of these as either input or output, so you can paste an HTML paragraph with <br> tags and get back a multi-line plain-text version (or vice versa).

The right ending for the destination.

Default to LF for code, configuration files, and anything handed to a Unix tool. Use CRLF for files going to Windows users, especially Notepad (which still struggles with LF alone). Use HTML <br> when the destination is a templated string in a web page. The converter lets you flip between any of these in one pass.

Frequently asked questions

Quick answers.

What is the difference between LF and CRLF?

LF (Line Feed) is the standard line terminator for Unix, Linux, and modern macOS. CRLF (Carriage Return + Line Feed) is the legacy typewriter-style standard used by Windows systems.

Can I convert a list into a single line?

Yes. Choose the 'Comma' or 'Space' option to replace all vertical line breaks with your preferred delimiter, turning a column of text into a single paragraph.

How does this tool handle HTML line breaks?

The '<br>' option replaces standard newlines with HTML break tags, which is useful when pasting plain text into web editors or code that doesn't preserve whitespace.

Is my text data secure?

Yes. The conversion logic is written in JavaScript and runs entirely inside your browser. No text is ever uploaded to a server or stored in a database.

People also search for

Related tools

More in this room.

See all in Formatters & Code