TXT to JSON
Converts text to JSON: a list of lines into an array, name=value lines into an object. The reverse conversion runs on the same page.
Table
JSON
The result is over a million characters, so it is not shown in the field; copy it or download it as a file.
Paste your text or open a file. A list of lines becomes an array, lines like name=value become an object, and line-by-line JSON is collected into a single array. Blank lines and spaces at the edges are left out of the result.
What stays a string
The phone number 0079161234567 is not written as a number: the leading zeros would be lost. A 20-digit account number also stays a string, because a number keeps only 15 significant digits and the rest turn into zeros. Uncheck the box if everything should stay a string.
Duplicate field names
An object in JSON cannot have two fields with the same name. A second "name" becomes "name_2" and does not overwrite the first one. Each line is split at the first separator, so an entry like time=12:30 and a link with an equals sign inside stay intact.
Back to text
Nesting is flattened into paths: customer.name=Anna, orders[0].total=15000. An empty object and an empty array are written as {} and [], otherwise the field would silently disappear from the text. A line break inside a value is written as \n, because otherwise it would split the line in two.
Rate this tool
Help us get better
Tell us what was missing.
Other tools
JSON Formatter
Format and repair JSON in the browser, flagging duplicate keys and long numbers
Regex Tester
Regex testing with a plain-language breakdown and hang protection
JWT Decoder
JWT parsing with fields explained and signature verification
CSV to JSON
A table to JSON with honest types and a reverse check
JSON to CSV
JSON to a table for Excel, with verification and formula protection
SQL Formatter
A readable query layout, verified against the source, with risky spots flagged
XML Formatter
Readable XML, errors explained with a hint, verified against the source
XML Validator
Markup, XSD schema, sitemap, YML and RSS rules, with the path to each error