Remove Line Breaks
Convert a multi-line document into a single line. Replaces line breaks with a single space.
0 characters
0 characters
About Remove Line Breaks
This tool replaces every line break (LF or CRLF) with a single space, collapsing the entire document onto one line. Useful for converting hard-wrapped prose into a single string suitable for a JSON value, a SQL query, or a CSV cell.
When to use it
- Embedding multi-line prose into a JSON string or YAML key
- Producing a single-line query from hand-edited SQL
- Cleaning up text that was hard-wrapped for email display
- Pasting multi-line content into a single-line input field
How it works
The regex /\r\n|\r|\n/g matches every common line ending and replaces it with a single space. Multiple consecutive line breaks become multiple spaces — combine with remove-extra-spaces to collapse them.
Examples
Hello World From TextyConverter
Hello World From TextyConverter
Frequently asked questions
- Are CRLF endings handled?
- Yes. Both \r\n (Windows) and \n (Unix) line endings are converted.
- What if I want no separator between lines?
- After running this tool, use find-and-replace to change ' ' to ''. Or use a custom regex replacement of /\r?\n/ → ''.
- Will adjacent blank lines produce multiple spaces?
- Yes — two consecutive newlines become two spaces. Follow up with remove-extra-spaces to collapse them.