TXT to JSON Converter
Turn plain text into JSON for apps, tests and settings. Make a simple array from a list, an array of objects with a key you choose, or an object from lines written as key: value. Numbers and true or false can become real values.
How to Convert Text to JSON
Quick answer: paste your text, choose Array of lines, Array of objects or key: value, then copy or download the .json.
-
1
Add your text
Paste it or open a .txt file.
-
2
Pick a shape
Array, objects or key: value.
-
3
Set options
Typed values and ids.
-
4
Download .json
Or copy it.
What You Get
Why Convert Text to JSON?
Lists, settings and notes are easy to write as plain text, but programs, test tools, apps and no-code platforms want JSON. Converting saves you from typing brackets, quotes and commas by hand, and avoids the small mistakes that make JSON invalid. Every result here is valid JSON, ready to paste.
Three Shapes
Array of lines turns each line into one item: a list of names becomes ["Ana", "Ben", "Chen"]. Array of objects wraps each line in an object with the key you choose, such as { "text": "Ana" }, optionally with an id. key: value reads lines like discount: 20 or discount = 20 and builds one object; lines without a separator are skipped.
Typed Values
With typed values on, 20 becomes the number 20, true and false become true and false, and null becomes null, which is what most programs expect. Text that is not a plain number, such as 2026-06-01 or 007, stays text. Turn the option off to keep every value as text.
Example
The sample key: value lines become { "title": "Summer Sale", "start": "2026-06-01", "discount": 20, "active": true }. Switch to Array of lines and the same text becomes an array of four strings.
Who Converts Text to JSON?
Developers turning lists into test data and fixtures, content managers preparing dropdown options and tag lists, no-code builders feeding lists into automations, teachers preparing data for coding classes, and anyone converting simple settings into a configuration file.
Step by Step
Paste the text or open a .txt file. Choose the shape that matches your text: a plain list, a list that needs a key, or key: value settings. Check the JSON, then copy it or download a .json file. To check or reformat it later, use the JSON Formatter.
Good to Know
In key: value mode, only the first colon or equals sign on a line separates the key, so values like times (10:30) stay intact. If the same key appears twice, the last value wins. To go back, use JSON to TXT, and for spreadsheet data, CSV to JSON.
Practical Tips
Write one item per line and avoid empty lines in the middle of a list, or keep Skip empty lines on. For settings, use a consistent separator: either name: value or name = value. If a value should stay text even though it looks like a number, such as a phone number with a leading zero, it stays text automatically; for other cases, turn typed values off. Add ids when you need a stable number for each item, for example for list keys in an app. Check the result in the JSON Formatter before using it in production.
Very long lists of thousands of lines convert instantly, and nothing is stored.
Private, Free and Instant
The converter is free and handles files up to 5 MB. There is no sign-up, no limit beyond the 5 MB file size and nothing to install. Everything runs in your browser, so documents, exports and private data are never uploaded or stored. Open a file from your device or paste text from another program, then copy the result or download it with the right file extension. It works on Windows, Mac, Linux, Chromebooks, iPhone and Android.
Turning Plain Text Lines Into JSON
Many data jobs start with a list in a text file: names, emails, URLs or product codes. Converting it to JSON gives you an array that a program can read directly.
How the lines are treated
Each line becomes one string in a JSON array. Empty lines can be skipped, spaces trimmed and special characters such as quotation marks and backslashes escaped so the result is valid.
Good uses
- Feeding a list of values into a script or API.
- Creating sample data for tests.
- Preparing a list for a configuration file.
Always check the result with a JSON validator if you edit it by hand. To get lines back, see JSON to TXT.
Frequently Asked Questions
Questions about text to JSON