TXT to JSON Converter

Turn plain text into JSON — lines to array, split by delimiter, or key: value pairs to an object, in your browser.

Files never leave your device Instant — no upload waitFree, no sign-up

Turn plain text into JSON — lists, delimited values, or key/value pairs

You have text; your code wants JSON. This TXT to JSON converter covers the three shapes that come up constantly: a list where each line becomes an array item, textsplit by any delimiter you choose, and config-style key: value lines that become a JSON object. Paste text or open a .txt file, pick a mode, done.

Small options that save cleanup

Trim whitespace tidies hand-written lists; skip empty items keeps blank lines from becoming empty strings in your array. Key/value mode splits at the firstcolon or equals sign, so values containing URLs or timestamps survive intact — and it honestly reports any lines it had to skip instead of silently dropping them.

Copy or download, pretty or minified

Output updates live as you type, pretty-printed for reading orminified for payloads, with one-click copy and a .json download. The item count is shown so you can sanity-check that 200 lines really became 200 entries.

Runs entirely in your browser

Text files are where people keep exactly the things that shouldn’t leak: env-style config, API endpoints, exported notes. Nothing you paste here is uploaded, logged or stored — the conversion is local JavaScript and works offline once the page has loaded.

Related free tools

Converting an actual table with columns? Use CSV to JSON — it parses quotes and delimiters properly. Validate or re-indent results in theJSON formatter. Deduplicate a list first withremove duplicate lines.

Frequently Asked Questions

  • What does this tool actually convert?
    Plain text into three JSON shapes: each line becomes an array item (a list of names → ["Ada","Lin"]); text split by a delimiter of your choice becomes an array; or lines like “key: value” become one JSON object ({"key":"value"}). Those three cover the vast majority of text-to-JSON jobs.
  • How is this different from CSV to JSON?
    CSV is a table — rows and columns with headers — and needs a real CSV parser (we have a dedicated CSV to JSON converter for that). This tool is for text that isn’t a table: plain lists, config-style key/value lines, or values separated by a custom character.
  • Which separators work in key: value mode?
    Both a colon (name: Ada) and an equals sign (name=Ada) — the line is split at the first one found, so values may freely contain more colons, like URLs or times. Lines with neither separator are skipped, and the tool tells you how many were.
  • Is my text uploaded anywhere?
    No — conversion runs completely in your browser. Config files and exported notes often contain credentials or personal data, so nothing is transmitted, nothing is stored, and the tool works offline once the page has loaded.
  • What do the trim and skip-empty options do?
    Trim removes spaces and tabs from the ends of each item, so “ apple ” becomes “apple” — almost always what you want with hand-written lists. Skip empty drops blank lines and empty items so stray newlines don’t become "" entries in your array.
  • Why are all values strings in the output?
    Because plain text has no types, and guessing creates bugs: “007” would lose its zeros, a phone number would become arithmetic. The converter keeps every value as a string; cast numbers and booleans in your own code, where you know what each field means.
  • Can duplicate keys exist in key: value mode?
    JSON objects can’t have duplicate keys — if the same key appears on several lines, the last occurrence wins, matching how every JSON parser would read it anyway. If you need all occurrences, convert as lines → array instead and process the pairs in code.
49 free tools
Instant — runs on your device
Files never uploaded
Free — no sign-up