Text to JSON

Turn plain text into a valid JSON object with a lines array — free, instant, nothing uploaded.

Files never uploadedNo sign-upWorks in your browserFree & unlimited

Convert in 3 simple steps

1

Add your text

Paste text or upload a .txt file.

📋
2

Convert to JSON

Get a valid object with a lines array.

🔄
3

Copy or download

Grab the JSON or save it as a .json file.

⬇️

Why use this text to JSON converter

Always valid

Output is produced by the standard JSON encoder.

🛡️

Properly escaped

Quotes, tabs and newlines are handled correctly.

🧾

Lines array

One array item per line, plus the full text.

📥

File or paste

Upload a .txt or paste directly.

🔒

Private

Runs locally; nothing is uploaded.

🆓

Free

No sign-up and no limits.

Plain text into valid JSON

Need your text as data? This tool wraps it in a valid JSON object — a lines array plus the full text — with everything correctly escaped, so you can drop it straight into code, a config file or an API request.

If your data is tabular, the CSV to JSON tool produces objects with named keys instead. You can also convert text to XML or HTML, or tidy the result with the JSON formatter.

Frequently asked questions

How do I convert text to JSON?
Paste your text or upload a .txt file and click Convert to JSON. The tool returns a valid JSON object containing an array of your lines plus the full text, ready to copy or download.
What does the JSON look like?
It's an object with two fields: `lines`, an array with one string per line of your input, and `text`, the whole input as a single escaped string. Both are safely JSON-encoded.
Are quotes and special characters handled?
Yes. Everything is passed through the standard JSON encoder, so quotes, backslashes, tabs and newlines are escaped correctly and the output is always valid JSON.
How is this different from CSV to JSON?
This tool treats your input as free-form text, one line per array item. If your data is tabular (rows and columns), use the CSV to JSON tool to get objects with named keys instead.
Is my text uploaded?
No. Conversion happens in your browser and your text is never sent to a server.

By Narender Chaudhary, Editorial & Product Lead · Updated June 2026