THE JSONFOLD GUIDE
Format JSON. Find the details.
JSON is easier to work with when you can see its structure. This guide shows how to format a document, check its syntax, remove unnecessary whitespace and explore nested data using JSONFold.
How to format JSON online
- Open the JSONFold JSON formatter and paste a document into the Source tab. You can also choose Import JSON to open a local file.
- Select Prettify. JSONFold checks the syntax and rewrites valid JSON with two-space indentation.
- Choose Copy to use the result elsewhere, or Export to download a JSON file.
For a quick demonstration, select Sample. It loads a fictional project document that you can edit without supplying your own data.
Before formatting
{"project":"Weekend atlas","published":false,"tags":["maps","travel"]}
After formatting
{
"project": "Weekend atlas",
"published": false,
"tags": [
"maps",
"travel"
]
}
Indentation and line breaks make the document easier to read. Formatting parses and serializes the input; it is not a byte-for-byte preservation tool. See the number-precision note below before formatting large numeric identifiers.
Validate JSON and fix syntax errors
Select Structure or Prettify to parse the current source. Valid JSON opens as a tree or a formatted document. If parsing fails, JSONFold shows the browser's syntax error message and keeps the source available for correction.
Common reasons a document is invalid:
- Trailing commas: change
{"ready": true,}to{"ready": true}. - Single quotes: JSON strings and object keys require double quotes. Use
{"theme": "sage"}, not a JavaScript object literal with single quotes. - Missing separators: put a colon between a key and its value, and a comma between adjacent properties or array entries.
- Comments: standard JSON does not accept
// commentsor block comments. - Unescaped characters: encode a line break inside a string as
\n, and escape quotation marks inside strings.
This is a JSON syntax validator. It does not validate against a JSON Schema, enforce your application's field rules, or confirm that an API response contains correct business data.
How to minify JSON
Select Compact to parse the source and serialize it without unnecessary indentation and line breaks. Spaces within string values remain part of those values. Copy or export the result when you need a single-line JSON document.
Minification reduces whitespace in the representation. It does not compress the file like gzip, encrypt its contents or make sensitive information safe to share. You can use Prettify again to restore an indented presentation.
Explore nested JSON in a tree viewer
The Structure tab separates objects, arrays and primitive values into branches. Expand an individual branch, or use Expand all to see the whole document. The right-hand field inspector shows properties for the selected object or the parent of a selected primitive value.
Use Search to find text in keys and values, then use Next and Previous to move between matches. JSONFold opens the matching branch and displays its path. Copy path copies that location, such as $.collections[0].places.
Ctrl/⌘ + Enter switches between Source and Structure. In Structure, Ctrl/⌘ + F focuses search, and arrow keys navigate the tree. Switch to Structure again after editing Source to rebuild the tree from the latest document.
Where does my JSON go?
JSONFold processes pasted text and local file imports in your browser. The application does not upload that content to an application server or automatically save documents. We use Umami analytics, served from analytics.exaultlabs.com, to measure website visits and count button actions using fixed event names. We do not run session recording or Meta Pixel. Button events do not include document contents, clipboard text, search terms, filenames, imported URLs, field names or JSON paths. Page URL query strings and fragments are excluded from analytics. Normal visit metadata is still collected. Only your light or dark theme preference is saved in this browser. Clipboard access happens when you use a clipboard control. Export anything you want to keep before closing the page.
Loading JSON from a URL is different: your browser contacts the address you provide. That server can observe the request and must allow cross-origin access for the import to succeed. If it does not, download the document yourself and use local file import instead.
Visiting the website still makes ordinary web requests to the hosting server. Its standard access logs may record request metadata such as an IP address, request URL and time. Browser extensions and other software on your device operate outside this tool's control. Do not put private document content into page URLs.
Common questions
Is JSONFold free?
Yes. The formatter, syntax checking, minifier and tree viewer are available without signup.
Can I paste JSON with comments or trailing commas?
No. JSONFold uses standard JSON parsing, not JSON5 or JSON-with-comments parsing. Remove comments and trailing commas first.
Can JSONFold handle very large files?
The practical limit depends on the document's shape and your browser's available memory. Deep nesting and expanding large arrays can be expensive. There is no promise that every file size or nesting depth will work.
Will large integers keep their exact value?
JSONFold uses JavaScript numbers. Integers outside the safe range of −9,007,199,254,740,991 through 9,007,199,254,740,991 can lose precision during parsing. Use quoted strings for identifiers that need exact preservation, or choose a tool with explicit lossless-number support.
Is JSONFold a JSON-to-CSV converter or a schema validator?
No. Its current focus is formatting, syntax checking, minification, file import/export and tree exploration.
For the format's definition, see the JSON standard, RFC 8259.