Input and output
Example: `red,blue` becomes `["red","blue"]`.
Paste values like a, b, c and get ["a","b","c"].
Advertisement
Paste a comma-separated list, clean it up automatically, and export a valid JSON array of strings. This tool is built for quick transformations in apps, scripts, configuration files, and APIs where the destination expects JSON, not a plain list.
The goal of this page is simple: turn a messy, human-written comma list into a clean, machine-friendly JSON array. People tend to write lists with extra spaces, trailing commas, mixed separators, and accidental blanks. JSON does not allow any of that. It has to be a well-formed array with quotes around each string and proper escaping for characters like quotation marks and backslashes.
This tool uses deterministic rules so you always know what you will get. It splits your input on commas and line breaks. Each token is trimmed. Empty tokens are removed. This means an input like a, b, , c, becomes ["a","b","c"]. The editor stays editable so you can paste, convert, then quickly adjust any edge case.
This converter outputs a JSON array of strings only. It does not try to detect numbers, booleans, objects, or nested arrays. If you need typed JSON, convert here for cleanliness, then adjust types in your destination system.
Many tools and APIs accept a JSON array but not a plain comma-separated list. A classic example is passing a list of tags, IDs, or allowed values into an API request body, a configuration file, or a deployment template. If the destination expects JSON and you paste raw text, it either fails validation or silently interprets your string as one value.
Converting a list to
A good mental model is that you are preparing data for code, not for people. In JavaScript, you can paste the output directly into a constant, pass it as part of a request payload, or store it in local configuration. In many no-code tools, a field that says βarrayβ still expects JSON syntax. A valid JSON array keeps you out of the gray area where a platform tries to guess what you meant.
["..."] format also reduces ambiguity. Commas, spaces, and line breaks can be interpreted differently by different systems. JSON arrays are explicit. Each element is clearly separated, and the format is widely supported across JavaScript, TypeScript, Python, Go, and most modern stacks.When you scrape or export values from a system, you often get a quick comma list. Turning it into JSON makes it ready for tooling, test fixtures, and reproducible inputs.
Feature flags, allowlists, and UI option sets are commonly stored as arrays. JSON arrays are easy to drop directly into code or a config file without additional parsing.
If you need one value per line in your destination, keep the JSON array anyway. Most editors can format JSON to multiple lines automatically, and the structure stays unambiguous.
This page intentionally avoids hidden heuristics. That keeps results predictable, but it also means certain inputs need a quick manual check. The most common edge case is a value that itself contains a comma, like a city name formatted as Toronto, ON. In CSV, that would be quoted. Here, it will be split into two values. If you have comma-containing data, you should use a proper CSV tool or replace those commas before conversion.
Another edge case is mixed separators. People paste lists separated by newlines, then add commas on some lines. This tool accepts both because it splits on commas and line breaks. The tradeoff is that it does not understand more complex formats like semicolon-delimited records or nested data. If you can normalize your list first, you will get cleaner output.
One more practical edge case is hidden whitespace. Values copied from spreadsheets or PDFs can contain non-breaking spaces or invisible separators. Trimming removes the obvious padding, but it cannot reveal every hidden character by sight. If your destination rejects the array even though it looks fine, paste the original list into a whitespace-cleaning tool first, then convert again.
The output is generated using the browser's JSON serializer, which safely escapes quotes, backslashes, and control characters. That is the main reason to use a converter instead of manual quoting. Even if your list includes characters like " or newline sequences, the resulting JSON stays valid.
Conversions happen in your browser. This page does not upload your pasted text or extracted file contents to a server. You decide when to copy the JSON output or download it.
Advertisement
Quick answers about comma lists, JSON output, files, and downloads.
Using this tool
Split a comma-separated list and output a JSON array.
Example: `red,blue` becomes `["red","blue"]`.
The generated JSON can be copied or downloaded after the tool validates the result.
For quoted CSV fields, use a CSV-specific converter rather than assuming every comma is a separator.
Conversion is performed in the browser. Copying or downloading happens only when you choose those actions.
Advertisement
A few related projects that pair well with this tool. Fast, focused, and privacy-friendly.
Translate text to Morse instantly, hear audio beeps, and learn patterns step by step. Fun learning for all ages.
Explore the origins, history, and evolution of words and phrases from myths, languages, and cultures.
Generate and play printable word search puzzles instantly. Great for classrooms, kids, and casual fun.