Paste JSON on the left
\n and \" cleaned automatically
JSONLAB is a free, instant, browser-based tool to convert JSON to string and string to JSON. No installation, no sign-up, no data sent to any server. Everything runs locally in your browser.
Paste any string into JSONLAB and it instantly converts it to a formatted JSON object. If your string is wrapped in surrounding quotes, JSONLAB strips them automatically before parsing. It also removes \n newline escape sequences and unescapes \" to bare " — making messy copied strings parse cleanly every time.
Paste your JSON object and use the Minify button to produce a compact single-line JSON string. Use Format to produce a pretty-printed, indented JSON string. Copy either with one click.
Format any JSON with proper indentation and line breaks. The JSON formatter makes your code readable instantly. Supports nested objects, arrays, strings, numbers, booleans and null values.
Validate JSON syntax in real time as you type. Invalid JSON is highlighted with the error message and the approximate line number so you can fix it instantly.
JSONLAB automatically fixes the most common JSON errors: trailing commas, unquoted keys, single quotes instead of double quotes, Python and JavaScript literals (True/False/None/undefined/NaN), missing commas between elements, and multiple root objects.
View any JSON as a collapsible, searchable tree. Keys are color-coded by type — strings in green, numbers in orange, booleans in blue, null in purple. Expand or collapse any node. Search and navigate matches with keyboard shortcuts.
Automatically removes \n escape sequences from JSON string values before parsing. No more manually cleaning up newline-polluted JSON strings copied from logs or APIs.
Unescapes \" to " automatically. Paste escaped JSON strings and JSONLAB handles the unescaping before parsing so the output is clean.
Minify JSON to a single compact line to reduce payload size for APIs, configs and storage. The minifier removes all unnecessary whitespace and line breaks.
Paste the string into the left panel of JSONLAB. If it has surrounding quotes they are stripped. The string is then parsed and shown as a formatted JSON object in the right panel instantly.
Paste your JSON into JSONLAB and click Minify. This produces a compact single-line JSON string you can copy and use in your code.
JSONLAB removes \n escape sequences from JSON string values automatically. Just paste and the newlines are gone.
Paste the invalid JSON into JSONLAB. It auto-detects and corrects trailing commas, unquoted keys, Python literals, single quotes and other common errors.
Yes. JSONLAB is 100% free, runs entirely in your browser, requires no sign-up and sends no data to any server.
Once loaded, JSONLAB works fully offline. All JSON parsing, formatting and fixing happens client-side in JavaScript.
JSON (JavaScript Object Notation) is a structured data format with keys and values. A string is raw text. Converting JSON to a string means serialising the object to its text representation. Converting a string to JSON means parsing the text into a structured object.