Guides Knowledge Base

Text to JSON Formatter (String to JSON)

Paste raw text or an escaped JSON string and get readable, indented JSON. Handles log lines, database columns and stringified payloads. Free, no upload.

A text to JSON formatter takes JSON that arrived as plain text — pulled out of a log line, a database column, or an escaped string field — parses it, and returns it indented and syntax-highlighted so you can actually read it.

Text, Strings, and JSON

JSON is always text. What differs is how many layers of escaping sit between you and the structure. A payload logged with JSON.stringify() twice arrives with \" in place of every quote; parsing it once yields a string, and parsing that string yields the object.

The Three Shapes You Will Paste

  • Minified JSON — {"a":1,"b":[2,3]}. One parse, then indent.
  • Escaped JSON string — "{\"a\":1}". Parsing unwraps the outer string first.
  • Plain prose — not JSON at all, and reported as a syntax error rather than guessed at.

How to Convert Text to Formatted JSON

  1. Paste the text into the input pane.
  2. If it parses, the output pane returns indented JSON with highlighting.
  3. If it does not parse, the error line tells you which character broke it — usually an unescaped quote.

Doing It in Code

// JavaScript — unwrap a doubly-encoded payload
const once = JSON.parse(raw);        // still a string
const data = JSON.parse(once);       // now an object
console.log(JSON.stringify(data, null, 2));

Who this guide is for

  • Read a JSON payload that was written into a single log line
  • Expand an escaped JSON string stored in a TEXT or VARCHAR column
  • Unpack a stringified body from a webhook delivery record
  • Make a one-line JSON blob from a terminal copy-paste readable

Try the free JSON Formatter

Runs entirely in your browser — no upload, no signup, and your data never leaves your device.

Open JSON Formatter

Frequently Asked Questions

What is the difference between text to JSON and JSON to text?

Text to JSON parses a string into structured data and prints it readably. JSON to text does the reverse, collapsing structure into a single escaped string — that is what the JSON Minifier produces.

Can it convert arbitrary prose into JSON?

No. The input must already be JSON, even if it is escaped or minified. Free-form English is not convertible to a JSON structure without inventing a schema, so it is reported as invalid instead.

How do I handle a payload that was stringified twice?

Format it once to strip the outer layer, copy the result, and format that. Each pass removes one level of escaping.

Tools mentioned in this guide

Related JSON Topics & Reference Articles