About This Tool

This tool collapses multiline text into a single line by replacing newline characters with a delimiter of your choice, space, comma, pipe, \n literal, or a custom string. It's invaluable for pasting multi-line JSON or XML into a single-line string variable, preparing data for shell commands that expect one-line input, joining CSV rows, and cleaning up log output. The reverse operation splits a single-line string back into multiple lines.

How to Use

  1. Paste your multiline text into the input field.
  2. Choose your replacement character, space is common for JSON, comma for CSV lists.
  3. Click Convert and copy the single-line result.
  4. For the reverse (split a one-liner), switch to Single → Multiline mode and pick the split delimiter.

Common Use Cases

  • Building a CC or BCC email list: paste a column of email addresses copied from a spreadsheet, choose the comma separator, and get a ready-to-paste comma-separated list for your mail client's CC field.
  • Turning a plain list into a JSON array: paste line-separated item names, wrap each with quotes manually or use the comma separator, then drop the result straight into a config file or a script's array literal.
  • Writing a SQL IN() clause: paste a list of IDs or usernames from a spreadsheet export, use the comma separator, and paste the output directly between the parentheses of a WHERE column IN (...) clause.
  • Collapsing multiline JSON for an environment variable: many hosting platforms (Docker, Vercel, Netlify) require JSON secrets to be a single line in an env file. Paste your formatted JSON and enable JSON minify to get a valid one-line value.
  • Cleaning up copy-pasted log output: paste a multi-line stack trace or log block and collapse it to one line before pasting into a chat window or ticket field that mangles line breaks.

Troubleshooting

  • JSON minify does nothing and falls back to line joining: the input is not valid JSON (a trailing comma, an unquoted key, or a stray line break inside a string). Validate the JSON structure first, then retry with JSON minify enabled.
  • Extra spaces appear at the start or end of lines in the output: turn on Trim each line so leading and trailing whitespace on every line is removed before joining.
  • Blank rows show up as extra separators in the output: enable Skip blank lines so empty lines from the source spreadsheet or file are dropped instead of producing double separators.
  • Pasted text from Windows Excel keeps stray characters between items: Windows exports commonly use CRLF line endings. This tool automatically strips the \r before joining, so the output should already be clean, if it still looks off, check for a hidden tab character instead of a real newline.

Frequently Asked Questions

Why do I need to convert JSON to one line?

Many CLI tools, environment variables, database fields, and API payloads require JSON to be on a single line. Multiline JSON is easier to read but can break scripts that parse line-by-line. Minified single-line JSON is also slightly smaller.

What's the difference between \r\n and \n line endings?

\n (LF) is the Unix/Mac line ending. \r\n (CRLF) is the Windows line ending. This tool handles both, it strips \r characters before processing to produce consistent output regardless of the source OS.

Can I use a custom delimiter like a pipe |?

Yes. Select the Custom option and type any character or string as your delimiter. Pipes, semicolons, tabs (\t), or even multi-character sequences like | with spaces all work.

Can I convert a spreadsheet column into a SQL IN() list?

Yes. Copy a column of values from Excel or Google Sheets, paste it here, choose the comma separator, and paste the output between the parentheses of a SQL IN (...) clause. Enable trim and skip blank lines first so stray whitespace or empty rows don't corrupt the query.

Does this tool support converting back from single line to multiline?

Yes. Use the Single to Multiline mode and pick the same delimiter that was used to join the text originally, comma, pipe, or a custom string, and the tool splits it back into separate lines.