How it works
The Text to JSON Converter transforms unstructured or semi-structured text into a JSON-compatible structure. It can convert delimited text to objects, parse key-value pairs (KEY: VALUE format), convert numbered lists to JSON arrays, and wrap plain text in a JSON string value.
Use cases arise when you have data in a text format and need it as JSON for an API request, configuration file, or JavaScript application. Rather than manually writing out the JSON structure, you provide the text and the converter handles the quoting, commas, and nesting.
How to use it: select the conversion mode from the dropdown โ "Key-Value pairs" parses "Name: Alice Age: 30" into {"Name":"Alice","Age":30}; "Numbered list to array" converts a numbered list to ["item1","item2"]; "Delimited text to objects" converts tabular text with a header row into an array of objects; "Wrap as string" creates {"text":"your content"}.
Output formatting: the JSON output is pretty-printed with 2-space indentation by default. Toggle to compact (minified) output if you need to paste it into a command-line argument or URL parameter.
Frequently Asked Questions
- Key-value pairs (Key: Value or Key = Value per line), numbered lists (1. item), bulleted lists (- item or * item), delimited text with a header row, and plain text wrapped as a JSON string value.
- Yes. Values that parse as integers, floating-point numbers, or the strings 'true'/'false'/'null' are typed correctly in the JSON output rather than kept as strings.
- Yes. Choose between compact (minified), 2-space, and 4-space indentation. Compact is useful for passing the JSON as a command-line argument or URL parameter.
- In Key-Value mode, values that span multiple lines (indented under the key) are captured as multi-line strings. In List mode, each line is a separate array element.