Stringify a JavaScript Object Without Uploading

Paste a JavaScript object or array – including JSON5 features such as unquoted keys or trailing commas – and get standard JSON back. You can indent with spaces (2 by default) or tabs, and optionally escape the result for safe use in HTML.

This tool runs in your web browser: your files and text are processed on your device and are not uploaded to TidyKit servers. Free, no sign-up.

How to stringify

1. Paste the object, for example `{ name: 'Ada', city: 'Lisbon', }`. 2. Choose space or tab indentation and the number of spaces if you use spaces. 3. Turn on HTML escaping if you will drop the JSON into a web page. 4. Copy the result.

That example becomes pretty-printed `{"name":"Ada","city":"Lisbon"}` with standard double quotes and no trailing comma.

What will fail

The input must be a value JSON5 can parse. Arbitrary JavaScript (functions, comments in odd places, or `undefined` in some positions) will be rejected. Escaping replaces &, <, >, quotes and apostrophes with HTML entities. Nothing is uploaded.

Frequently asked questions

Is this the same as the JSON formatter?

The formatter expects JSON. This page is more relaxed: it parses JSON5, then writes strict JSON.

Is my code uploaded?

No.

When should I enable HTML escaping?

When the JSON will be placed inside HTML. For APIs or files, leave it off.

Can I stringify a single quoted string only?

You can paste any JSON5 value the parser accepts, including arrays and objects. A bare unquoted word is not valid input.

More JSON Tools