Text to JSON Converter
Transform structured lists, objects, or raw text into valid, pretty-printed JSON data
Give plain text a JSON structure
Notes, config snippets, copied tables and one-item-per-line lists are easy to read but awkward for code to consume. This converter reads text you paste and builds a JSON array from it, using one of three parsing modes. It works in your browser and needs no formatting knowledge beyond choosing the mode that matches your text.
Converting text to JSON
- Paste your text into Input Data (Structured Text). The small clipboard icon pastes from your clipboard and the trash icon clears the box.
- Choose a Parsing Mode: Key: Value Pairs, CSV (Auto-detect) or Array of Lines.
- Choose an Output Style: pretty print with 2 or 4 spaces, or minified.
- Press Generate JSON.
- Use Copy JSON or Download .json, which saves data.json. The Analysis card shows the output size in KB and an item count.
What each mode expects
- Key: Value Pairs treats blocks of text as records. A record ends at a line containing three dashes or at a blank line. Inside a block, each line is split at its first colon into a key and a value, so a time like 10:30 stays intact in the value. Lines with no colon are skipped. Every value becomes a string.
- CSV (Auto-detect) takes the first line as the header and turns each following line into an object. Lines are split on commas, tabs, pipes or semicolons, whichever appear. Missing cells become null. You need at least two lines or the result is an empty array.
- Array of Lines simply returns each non-empty line as a string inside a JSON array.
Realistic uses
- Converting a contact list typed as Name, Age and City lines into an array of objects for a test fixture.
- Turning a list of keywords or URLs, one per line, into a JSON array for a script.
- Cleaning up a copied table with pipe or tab separators into records.
- Prototyping API responses from documentation-style notes.
Details that matter
Numbers and booleans are not detected; a value such as 30 is written as the string "30". If you need real numbers, post-process the output or use a CSV-to-JSON tool with type detection. Because a blank line also ends a record in Key: Value mode, do not leave empty lines inside a single record. In CSV mode the splitting is not aware of quotes, so a cell such as "Paris, France" would be broken at the comma. Errors are shown in a simple alert message.
Related Tools
Related Tools