JSON viewer, formatter and path finder
Paste JSON and read it as a fast tree. Search keys and values, copy the exact path of any value, and copy the document formatted or minified.
Paste JSON
Tree
The tree of your JSON appears here.
Paste JSON in first; its readable text, tables and types appear here.
Before
After
Differences
Paste valid JSON on both sides to compare them. Key order and spacing are ignored.
How to view and search JSON
- Paste the JSON, open a file, or try the example.
- Open and close objects in the tree, or use the arrow keys.
- Type in the search box; Enter moves to the next match and opens it.
- Select a value and copy its path or the value itself.
Paths you can paste straight into code
Every value has a path. pastejson writes it three ways: JavaScript (data.items[3].id) for code and the browser console, JSONPath ($.items[3].id) for API tools and tests, and jq (.items[3].id) for the terminal. Keys with spaces or dashes are quoted correctly in each notation, so the path works when you paste it.
Built for large and messy input
The tree draws only the rows you can see, so a document of several megabytes opens in well under a second, and large inputs are parsed in a background worker so typing stays smooth. JSON copied from real places is often not quite valid: comments from a config file, a trailing comma, single quotes from a JavaScript object, one object per line from a log, or a JSON object in the middle of a log line. pastejson accepts all of these and tells you exactly what it fixed, instead of failing with a cryptic message.
When the JSON is broken
If the text cannot be read, the error says what is wrong and on which line and column, and clicking it moves the cursor there. Common cases are a missing comma between two values, a string that is never closed, or a bracket that does not match.
Questions
Is my JSON uploaded?
No. Parsing, the tree, search and copying all happen in your browser. Nothing you paste is sent to a server or stored.
How big a file can I open?
Files up to 50 MB can be opened. A 6 MB document becomes an interactive tree in about half a second on a laptop.
Does it accept JSON with comments or trailing commas?
Yes. Comments, trailing commas, single quotes, unquoted keys, JSON Lines and JSON inside other text are accepted, and each repair is listed.
How do I format or minify JSON?
After pasting, use Copy formatted for two-space indentation or Copy minified for a single line.
Which path notation should I use?
JavaScript for code, JSONPath for API testing tools, jq for the command line. You can switch at any time.