Compact JSON
Use one-line JSON for API payloads, logs and storage when you want valid JSON without unnecessary whitespace.
{"name":"Ada","active":true}Paste JSON and get the exact output you need: compact one-line JSON, an escaped string, destringified or unstringified nested values, formatted JSON or a ready-to-paste JavaScript constant.
Runs locally in your browser. Your JSON is never uploaded.
JSON.stringify-style output without writing code.
Paste an object, array, primitive or nested stringified value. Invalid JSON is rejected before anything is copied.
Use one-line JSON for API payloads, logs and storage when you want valid JSON without unnecessary whitespace.
{"name":"Ada","active":true}Use an escaped string when JSON must live inside another JSON field, source string, environment variable or test fixture.
"{\"name\":\"Ada\",\"active\":true}"Use the JavaScript option when you need readable data that can be pasted directly into source code.
const data = {
"name": "Ada"
};JavaScript's JSON.stringify() converts a value into JSON text. This tool first validates the input, then produces compact JSON, an escaped string literal or a JavaScript assignment.
Minifying removes spaces and line breaks from JSON. Stringifying can also mean encoding the complete JSON value inside a string, which adds wrapping quotes and escape characters. This page supports both.
Yes. Destringify (also called unstringify) removes up to five valid layers and formats the final object, array or primitive.
No. Parsing, validation and conversion happen locally in your browser.
Need to compare two values instead? Use the JSON Diff Tool. Building a test endpoint? Try the JSON Mock API Generator.