stringtojson.
SMALL TOOL. BIG CLARITY.

String to JSON
converter.

Convert a string to JSON online, including escaped and double-encoded payloads.
Format, validate, and download the result in your browser.

Free to use · No signup · Nothing uploaded
INDENT
Input string0 B
JSON output0 B
Your formatted JSON will appear here.
Ready when you are.⌘ / Ctrl + Enter to convert
♧ Your data stays yours. All conversion happens on your device.
A WORKED EXAMPLE

Convert escaped JSON strings into objects or arrays

Use this string to JSON converter to parse escaped JSON online. The outer quotes in this example wrap an object in a string; String → JSON unwraps that layer and formats the result. An input containing a JSON array produces an array.

Input string
"{\"name\":\"Maya\",\"attempt\":2}"
JSON output
{
  "name": "Maya",
  "attempt": 2
}

For more examples, read how to convert a string to JSON. If parsing fails, check our guide to fixing common JSON errors, or learn how escaped and double-encoded JSON works.

IN YOUR OWN CODE

Convert a string to JSON in JavaScript, Python and C#

The converter is the quickest way to inspect a payload. In code, each language has one standard call. If the result is still a string, the JSON was encoded twice, so parse it again.

JavaScript
const data = JSON.parse(text);
// Still a string? It was encoded twice.
const value = typeof data === "string" ? JSON.parse(data) : data;
Python
import json

data = json.loads(text)
if isinstance(data, str):
    data = json.loads(data)
C#
using System.Text.Json.Nodes;

JsonNode? data = JsonNode.Parse(text);
string? name = (string?)data?["name"];

Step-by-step guides: JavaScript, Python and C#.

FROM STRING TO STRUCTURE

Three steps. Zero friction.

01

Bring your string

Paste a payload, upload a file, or drop it into the editor.

02

Make it readable

We unwrap escaped layers. You choose the indentation and key order.

03

Take it with you

Copy the result or save a JSON file. Ready for whatever comes next.

GOOD QUESTIONS

A few things to know.

Simple by design. Useful by nature.

What kind of strings can I convert?

Use valid JSON, a quoted JSON string, escaped JSON, or a payload encoded multiple times. The converter unwraps JSON string layers automatically.

Is my data sent to a server?

No. Converter input stays in your browser and is never stored or uploaded. Page analytics runs only if you accept it in the cookie banner. See our Privacy Policy.

What does “layers unwrapped” mean?

Each layer is one round of string encoding. One layer is normal for JSON stored as text; two or more means the payload was serialized twice. JSON unescape explains the details.

Why do I see a warning about large numbers?

JavaScript cannot represent every integer above 9,007,199,254,740,991 exactly, so such values may change when parsed. Send long IDs as strings. Read why large JSON numbers change.

Why won't my string convert?

JSON requires double-quoted keys and strings, without comments or trailing commas. The error message points to the position that needs attention.

Can I convert JSON back into a string?

Yes. Select JSON → String to create a single escaped JSON literal for use in code or a payload.