Convert plain text, TXT files, line lists, key-value text, and delimited records into JSON. Pick one of three parsing modes, review the live preview and warnings, then copy or download the result.
Paste plain text into the editor or open a local .txt, .csv, .tsv, .text, or .log file. The file is read in your browser and never uploaded.
Turn one item per line into a JSON array, in the original input order. Empty lines can be skipped and duplicate values can be removed while keeping the position of the first occurrence.
Parse lines such as name: Alice or name=Alice into a JSON object. The line is split at the first separator only, so url: https://example.com/a:b keeps the full URL as its value.
Convert comma-, tab-, semicolon-, or pipe-separated text into a JSON array of objects, with auto-detection available. Use the first row as headers, or let the tool name the columns column_1, column_2, and so on.
Review the first 10 parsed lines, key-value entries, or data rows before exporting. Duplicate keys, skipped lines, and rows with a different number of columns are reported in the preview.
When enabled, lowercase true and false become booleans and plain integers or decimals such as 30 or 1.5 become numbers. It is off by default, so values such as 00123, 1.10, TRUE, and NULL stay strings.
Copy the generated JSON to the clipboard for use in scripts, APIs, configuration files, test fixtures, or frontend applications. The copy always contains every parsed item, not just the previewed ones.
Download the full result as a .json file after reviewing the parsed structure and warnings.
Text parsing and JSON generation happen in your browser. No account is required and the input text is not sent to a remote conversion service.
Paste plain text into the input editor or open a local .txt file. The input can be a line list, key-value text, or a delimited table.
Select Lines to JSON array for one item per line, Key-value text to object for key/value records, or Delimited text to objects for table-like data. Loading a built-in example switches the mode for you.
The available options depend on the mode: the delimiter and header switch appear in delimited mode, the key separator appears in key-value mode, and skip empty lines and remove duplicate lines apply to line and key-value text. Type inference, empty-value, trim, and indent options are always available.
Check the detected lines, keys, rows, and columns together with any duplicate-key, skipped-line, or uneven-row warnings before creating the final JSON.
Click Convert to JSON, then copy the result or download it as a .json file. The output also updates automatically while you type, so you can adjust the options and watch the result change. Validate the output before sending it to another system.
A small comma-separated table with a header row, converted into an array of JSON objects.
name,age,city Alice,30,New York Bob,25,London
Comma-separated text whose first line is the header row.
[
{
"name": "Alice",
"age": 30,
"city": "New York"
},
{
"name": "Bob",
"age": 25,
"city": "London"
}
]Shown with Infer basic types enabled. The option is off by default, so 30 and 25 remain the strings "30" and "25" unless you turn it on.
Indent is set to 2 spaces in this example. The downloaded file always contains every parsed row, even when the preview shows only the first 10.
TXT to JSON conversion turns unstructured or semi-structured text into a JSON object or array. Unlike a fixed file-format conversion, plain text does not define one universal structure, so the converter has to apply explicit parsing rules.
A line list, a key-value file, and a CSV-like table are all text, but they should produce different JSON shapes. Choosing the correct parsing mode matters more than changing the file extension.
Input:
Alice
Bob
CharlieOutput:
["Alice", "Bob", "Charlie"]This mode suits lists of IDs, URLs, emails, tags, and keywords. The array keeps the input order, and Remove duplicate lines drops later duplicates while keeping the first occurrence in place.
Input:
name: Alice
age: 30
active: trueOutput with Infer basic types enabled:
{
"name": "Alice",
"age": 30,
"active": true
}With the option off, which is the default, the output is:
{
"name": "Alice",
"age": "30",
"active": "true"
}Key-value parsing splits each line at the first separator only. A line such as url: https://example.com/a:b yields the key url and the value https://example.com/a:b, rather than breaking the URL apart. Lines with no separator, or with an empty key, are skipped and counted in the preview instead of failing the conversion.
Input:
name,age,city
Alice,30,New York
Bob,25,LondonOutput:
[
{"name":"Alice","age":"30","city":"New York"},
{"name":"Bob","age":"25","city":"London"}
]Use a CSV-compatible parser when fields can contain delimiters, escaped quotes, or line breaks. In delimited mode, quoted fields are supported: a value wrapped in double quotes may contain the delimiter and line breaks, and two consecutive double quotes inside it represent one literal quote. A simple split on the delimiter is not sufficient for that kind of data.
Plain text carries no reliable type system. This converter only infers a narrow set of values, and only when Infer basic types is enabled: lowercase true and false become booleans, and plain integers or decimals matching -?\d+ or -?\d+\.\d+ become numbers.
00123 stays the string "00123".1.10 would lose its trailing zero as a number, so it stays text when inference is off.TRUE, FALSE, and NULL are not recognized and stay strings.1e5 is not recognized and stays a string.Keep type inference disabled when preserving the exact source text matters more than convenience.
Delimited input may contain a header row, missing values, extra values, or blank headers. When First row is header is off, or a header cell is blank, the converter generates the names column_1, column_2, and so on. Rows with a different number of columns are highlighted in the preview and reported as a warning; the conversion still runs, missing cells become empty values, and extra values beyond the column count are ignored.
Plain text can be ambiguous. A paragraph, a log file, a Markdown document, or an AI response cannot become a meaningful JSON structure without rules. Use an explicit pattern such as one item per line, key-value pairs, or a consistent delimiter. For AI-generated output, first make sure it follows a predictable structure.
TXT to JSON can mean several things. This page handles structured plain text and text files. If the input is already a JSON-encoded string such as "{\"name\":\"Alice\"}", use a JSON unescape workflow instead. If the input is an ordinary JSON document, use a JSON formatter or validator rather than a text converter.
A JSON array stores many values inside one JSON document. JSON Lines stores one JSON value per line. This page outputs a JSON array or a JSON object and does not provide a JSONL output mode, so if a downstream system needs JSONL, convert it with a separate step.
This converter reads text and generates JSON in the browser rather than uploading the input to a remote service. That is useful for internal lists and development data, but it is not a secret-management system. Avoid entering credentials, tokens, private customer records, or confidential production text into any online tool.
For very large files, repeatable data pipelines, strict CSV compatibility, confidential data, or automated processing, use a local parser or command-line workflow. Browser conversion is best suited to quick transformations, inspection, and small-to-medium inputs.