JSON Stringify Online.
Convert JSON into an escaped string literal for code, config, logs, or database fields. Choose double quotes, single quotes, or backticks, then unstringify the escaped value back to JSON on the same page.
No signup / No uploads / Stringify and unstringify
Stringified output
JSON stringify online - free and private
A JSON stringify online tool converts valid JSON into an escaped string literal. That is useful when you need to paste JSON into JavaScript, app config, logs, database text fields, documentation, test fixtures, or any place where quotes and newlines must be escaped. This tool validates the JSON first, then stringifies it safely in your browser.
How to stringify JSON in three steps
- Paste valid JSON into the input box or load the sample.
- Choose quote style - double quotes, single quotes, or backticks.
- Stringify and copy the escaped string literal or download it as text.
Escape JSON for embedding in code or DB fields
Stringified JSON escapes the characters that break string literals: quotes, backslashes, newlines, tabs, carriage returns, and control characters. Use double-quoted output for strict JSON string values, single-quoted output for many code and text-field workflows, and backtick output when a JavaScript template literal is more convenient.
Unstringify JSON on the same page
Need to reverse the process? Switch to Unstringify / parse
mode and paste a quoted escaped string such as
"{\"name\":\"Ada\"}". The tool decodes the string body,
validates the decoded JSON, and returns formatted or minified JSON.
The three arguments to JSON.stringify
JSON.stringify(value, replacer, space) The first is your data. The third is the one everyone actually wants and half of people never learn — it is the indent:
JSON.stringify(data) // minified
JSON.stringify(data, null, 2) // pretty-printed, 2-space
JSON.stringify(data, null, " ") // pretty-printed, tabs The second is a replacer — pass an array of keys to keep only those fields, or a function to transform values as they serialise. It is the tidiest way to strip a password out of an object before logging it.
The silent data loss nobody warns you about
Several JavaScript values have no JSON equivalent, and
JSON.stringify discards them without a word:
JSON.stringify({
a: undefined, // key vanishes entirely
b: () => {}, // functions vanish
c: Symbol("x"), // symbols vanish
d: NaN, // becomes null
e: Infinity, // becomes null
f: new Date(), // becomes an ISO string
});
// {"d":null,"e":null,"f":"2026-07-12T10:00:00.000Z"}
Keys a, b, and c are simply
gone. Inside an array they behave differently again —
undefined becomes null rather than disappearing, which
quietly changes your data instead of shrinking it.
And note f: a Date serialises to a string and
does not come back as a Date when you parse it. Round-tripping
through stringify and parse gives you equivalent data, not identical data.
Circular references throw
const a = {};
a.self = a;
JSON.stringify(a); // TypeError: Converting circular structure to JSON JSON is a tree and cannot express a cycle, so there is no way around this except to break the cycle first — either delete the offending reference, or pass a replacer that tracks objects it has already seen and drops repeats.
JSON stringify vs JSON escape
JSON Escape is best when you have raw text and want to make it safe inside a JSON string. JSON Stringify is best when you already have full JSON and want to serialize the whole object, array, string, number, boolean, or null as an escaped string literal. You can also use JSON Formatter or JSON Validator before embedding. Learn more in how to stringify JSON online.
FAQ
JSON stringify, answered.
How do I stringify JSON online? +
Paste valid JSON into the JSON Stringify tool and press Stringify JSON. The tool validates the JSON, optionally minifies it, escapes quotes and control characters, and wraps the result as a string literal.
What does JSON stringify mean? +
JSON stringify usually means converting a JSON value or object into a string representation. This tool turns valid JSON into an escaped string that can be embedded in code, config, database fields, logs, or examples.
Can I unstringify or parse the string back to JSON? +
Yes. Switch to Unstringify / parse mode, paste a quoted escaped JSON string, and the tool decodes the string body and parses it back into valid JSON.
Which quote styles are supported? +
You can output double-quoted JSON string literals, single-quoted strings, or backtick strings. Double quotes are best for strict JSON, while single quotes and backticks are useful for code snippets and embedding workflows.
Can I escape JSON for embedding in code or a database? +
Yes. The stringified output escapes backslashes, quotes, newlines, tabs, and control characters so the JSON text can be pasted into code, config values, logs, or database text fields.
Is my JSON uploaded when stringifying? +
No. JSON stringify and unstringify both run entirely in your browser. Your data is never uploaded, stored, logged, or sent to a server.
What does JSON.stringify actually do? +
It converts a JavaScript value into a JSON string — serialising objects and arrays, and escaping quotes and control characters so the result is a single valid string. The second argument is a replacer for filtering or transforming values; the third is the indent, so JSON.stringify(data, null, 2) pretty-prints while JSON.stringify(data) minifies.
Why does JSON.stringify drop some of my fields? +
Because several JavaScript values have no JSON equivalent and are silently discarded: undefined, functions, and symbols vanish from objects entirely. In arrays they become null instead, which is worse because it is not obvious. Dates are converted to ISO strings, and NaN and Infinity become null. This silent data loss is the most common stringify surprise.
How do I stringify an object with circular references? +
You cannot, directly — JSON.stringify throws a TypeError on a circular structure, because JSON is a tree and cannot represent a cycle. Either remove the circular reference first, or pass a replacer function that tracks visited objects and drops repeats. Modern environments also offer structuredClone for copying, though that still will not serialise a cycle to JSON.
What is the difference between stringify and parse? +
They are exact opposites. Stringify turns a value into a JSON string for storage or transmission; parse turns a JSON string back into a value your code can use. Round-tripping through both usually returns equivalent data, but not always identical data — a Date becomes a string on the way out and stays a string on the way back.