List Converter — Lines, Commas, Arrays and SQL IN From One Paste

Paste any messy list and get it back as plain lines, comma or semicolon separated text, a Markdown bullet list, a JavaScript array, JSON, an SQL IN list or HTML items — with trimming, empty items dropped, duplicates removed and natural sorting applied on the way. Everything runs locally in your browser.

A · Paste the list

B · Same list, other shapes

Click a row to load its full text below

Splitting items into ten shapes

One shape in, ten shapes out

A list arrives in one shape and you need another. Tag names pasted from a design file have to become an IN (...) clause; a column copied out of a spreadsheet arrives tab-separated and has to become a JSON array. The raw text is cut into clean items, and those same items are then shown in ten shapes so you can pick the one that fits.

Nothing is sent anywhere: the splitting and the re-joining both happen in the script, so a list of internal names stays on your machine.

How the items are found

If the separator box is empty, the text is split on the first of these that appears in it:

  1. line breaks
  2. | — pipes with a space on each side, which is how a lot of dashboards export
  3. semicolons
  4. tabs — the shape a spreadsheet column arrives in
  5. commas

That order is a guess, and a guess can be wrong. A list of addresses has commas inside each item and line breaks between them, so line breaks win, which is the right answer — but a single line of names separated by | and a single line separated by | with no surrounding spaces are different, and only the first is detected. Write the separator into the box whenever the list is on one line.

The separator box takes literal text, not a pattern. Two spaces work, so does --, so does "," if that is literally what sits between your items.

Cleaning, and the order it happens in

  1. Trim removes the space each side of an item. Left on by default because nearly every paste has it.
  2. Drop empties removes items that are empty after trimming. Left on by default; this is what makes a trailing comma harmless.
  3. Remove duplicates keeps the first spelling of each item. Off by default, because a shopping list is allowed to have three of the same thing.
  4. Sort last, so a de-duplicated list is sorted rather than sorted and then thinned.

Duplicate matching is exact, so Apple and apple are two items. Sorting is not case-sensitive, and it is number-aware: item2 sorts before item10, which plain alphabetical order gets backwards.

The sort compares character codes rather than dictionary collation, so Latin names come out ahead of Chinese ones, and Chinese items are ordered by code point, not by pinyin. For a list that mixes the two it is usually better to leave sorting off and order the items yourself.

The ten shapes

Shape Watch out for
Plain lines The one to reach for when the target takes a text file.
Comma separated No space after the comma only if your items already carry one.
Semicolon separated What most config formats and CSS-ish lists want.
Pipe separated Wiki tables and inline blog lists.
Markdown bullets Renders as a list in any README or issue.
Numbered list The numbers are text, so editing the list does not renumber it.
JavaScript array Quoted with your wrap character if you gave one, otherwise double quotes.
JSON array Always valid, always double quoted, and escapes what is inside.
SQL IN list Single quotes with the doubling an SQL string literal needs.
HTML list items Escaped, so a list of tags shows as text instead of markup.

The wrap box affects the four plain shapes plus the JavaScript array. It is ignored by JSON, the SQL list and HTML — those have to quote themselves in order to be correct.

Questions

Does my list go anywhere? No. The splitting and joining happen in the script, and nothing in it takes your list out of the tab.

Why did my one-line list come back as a single item? Either the separator was not one of the five the detector tries, or you typed a separator that is not literally in the text. The result line says which separator was used, and the warning appears when the typed one matched nothing.

Is there a size limit? 100 000 characters of input, and each row in section B previews 200 characters before the click loads the full text.

Support on PayPal