ForHosting KIT · Text & AI

Join lines with a separator

Three lines with apple, banana and cherry become apple, banana, cherry on a single line. Blank rows are skipped by default, spaces around each line are trimmed, and you can use a pipe, semicolon, tab or nothing at all. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
apple banana cherry
You get
Text
apple, banana, cherry
Original
apple banana cherry
Separator
,
Quantity
3

Joining lines with a separator is the everyday job of turning a vertical list into one inline string: tags for a CSV cell, emails for a BCC field, SKUs for a query parameter, or names for a comma-separated heading. This join-lines-with-separator tool reads your multiline text, splits on Windows, Unix, classic Mac, and Unicode line breaks, optionally skips blank rows, and joins the remaining lines with the delimiter you choose—comma and space by default, or a pipe, semicolon, tab, or any other glue. Unlike unwrap tools that only swap each newline for a space, this capability treats every line as a list item and performs a true Array-style join so empty rows do not become accidental extra delimiters unless you ask for them.

How joining lines with a separator actually works

Joining lines with a separator is a list transform, not a paragraph unwrap. The default separator is a comma followed by a space, which is what most people want when they search for join lines with a comma or turn a column into inline tags. You can pass any string: a bare comma, a pipe with spaces, a semicolon, a tab, the word AND, or even an empty string if you want the pieces to touch.

Next the engine splits the paste on every common line terminator. Windows CRLF is treated as one break so a file saved on a PC does not produce a phantom empty token between carriage return and line feed. Lone LF, lone CR, Unicode next-line, line separator, and paragraph separator each start a new item.

Every item is then trimmed so accidental spaces around a pasted column do not leak into the joined string. Finally the remaining pieces are concatenated with the chosen glue and returned as one line.

Turn a column of names or emails into one field

Paste a vertical list of addresses or display names and copy a single comma-separated line into a BCC box, CRM field, or invitation form.

Collapse tags and SKUs for feeds and queries

Join a stack of product tags or warehouse SKUs into one delimited cell for a merchant feed, URL parameter, or import template.

Build inline lists for configs and SQL IN clauses

Convert a pasted column of identifiers into a pipe, semicolon, or comma list that a config file or query can consume without extra editing.

What separator does this tool use by default?

A comma followed by a space. Override separator with any string—comma only, pipe, semicolon, tab, or empty to hard-join with no glue.

Does joining lines skip blank rows?

Set it to false to keep empty tokens between consecutive separators.

How is this different from removing line breaks?

Remove-line-breaks unwraps a paragraph by replacing each break with a space. Join-lines-with-separator treats every line as a list item and joins those items with a delimiter you choose.

Which line endings are recognized?

Windows CRLF (one break), Unix LF, classic Mac CR, Unicode next-line, line separator, and paragraph separator. Each line is trimmed before the join.

What does join-lines-with-separator cost?

The browser tool is free and runs locally.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/str/join-lines

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/str/join-lines \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"apple\nbanana\ncherry"}'
{
  "text": "apple\nbanana\ncherry"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "str.join_lines",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_chars100000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The response returns the single-line result plus the separator used, how many lines were seen, how many pieces were joined, and an echo of the original paste. Empty input is rejected with invalid_input. Successful API calls cost $0.002 per item.

How joining lines with a separator actually works

The engine first reads the required text field and two optional controls: separator and skip_empty. When skip_empty is true, which is the default, blank or whitespace-only rows are dropped before the join so a list with gaps becomes apple, banana, cherry rather than apple, , banana. When skip_empty is false the empty tokens stay, which is the same contract as Array.join in JavaScript: two consecutive breaks become two consecutive separators.

Input contract, response shape, and empty-input rejection

An empty separator is legal and hard-joins pieces with no characters between them. A single-line paste with no breaks returns that line unchanged, count one. Pin these fields in continuous integration so a future refactor cannot silently change CRLF handling or the default comma-space glue. Send a JSON body with the required string field text set to the non-empty multiline sample you want flattened. Aliases input, value, s, content, body, and lines are accepted when a form generator or older client uses those names. Missing text, a non-string value, or a zero-length string all raise invalid_input and name the field, and those failures are not charged on the prepaid API. Optional separator defaults to comma-space; aliases sep, delim, delimiter, joiner, and glue work the same way. Extremely long separators above the documented character cap fail validation so a single request cannot inflate Worker memory. Optional skip_empty is a boolean defaulting to true; aliases skip_blanks, drop_empty, and ignore_empty are accepted, and the strings true, false, 1, and 0 coerce as expected. On success the response includes text as the single joined line ready to copy, original as an echo of the input for before-and-after displays, separator as the glue actually used after defaults, count as how many pieces were joined, line_count as how many segments the split produced before skipping blanks, skip_empty as the effective flag, and method always set to join_lines so downstream code can branch without sniffing shapes. A trailing newline with skip_empty true does not append a dangling separator.

Where a join-lines-with-separator tool earns its keep

Call the free in-browser join-lines-with-separator tool when you paste a column from a spreadsheet, a list of emails from a ticket, a stack of tags from a CMS, or a block of SKUs from a warehouse export and need one inline string for a form field, a query parameter, or a CSV cell. Here every line is a list item and the separator is yours to choose. It is also not sort lines, dedupe lines, or count lines—those keep the vertical shape. A typical workflow pastes a column of product tags, leaves the default comma-space separator, and copies the joined text into a merchant feed. Another workflow sets separator to a pipe or a semicolon to match a legacy importer. Use the prepaid KIT API when a pipeline, CMS plugin, or mobile client needs the same contract under balance at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. This landing is for the search join lines with separator, join lines with comma, and convert list to delimited text. It is not the same intent as remove line breaks, which unwraps a wrapped paragraph by replacing each break with a space so sentences stay readable. A third workflow sets skip_empty to false when empty slots in the source column must survive as empty tokens between delimiters. Pair this endpoint with trim or sort tools in a later step if you need extra hygiene, but keep join-lines-with-separator as its own page so the delimited-list query is not mixed with paragraph unwrap.

Read the full KIT documentation →