A JSON export may arrive as one long line even though it contains many nested objects and arrays. That compact layout is fine for software. When you need to find a missing setting or compare two items by eye, indentation and a tree view help you see the structure. The first step is to confirm that the input is valid JSON, then choose an output that suits the next task.
TinyToolbox JSON Formatter & Viewer parses JSON and lets you format it with two spaces, four spaces, or no extra indentation. It also displays expandable objects and arrays. Use it to inspect a response or fixture, but keep the original if the exact characters, order of keys, or precision of unusually large numbers matters.
Choose a representative input
Start with the JSON body itself. If you copied a response from a terminal or a browser inspector, leave out the status line, HTTP headers, and any surrounding commentary. If a message encloses the JSON in a code fence, copy the content inside the fence. Fence markers belong to Markdown and will make the input fail to parse.
The top-level value can be an object, an array, or a single value such as a string, number, boolean, or null. An object is useful for settings with named properties. An array is a sequence of items that can be inspected by position. If your file contains a series of separate JSON objects on separate lines, it may be newline-delimited JSON. The formatter expects one complete value, so inspect a record individually or convert the sequence to an array where that fits your workflow.
For example, the following payload describes one project with two tasks and a nullable owner field:
{"project":"Spring workshop","tasks":[{"name":"Book room","done":true},{"name":"Print signs","done":false}],"owner":null}
The formatter can make the same information easier to scan. The nested array will have a visible entry for each task, and the tree can show which properties belong to each one.
Format the JSON in TinyToolbox
- Open JSON Formatter & Viewer.
- Paste the source under JSON input, or load a single JSON file using the file chooser or drop area.
- Choose 2 spaces, 4 spaces, or Minified under Output spacing.
- Select Format JSON.
- Review Converted output and expand any relevant entries in the tree.
- Choose Copy output or download formatted.json.
The tool processes the input in your browser. The file picker has a 4 MB limit, and the parsed text is limited to one million characters. A file small enough for the picker may still contain too much text to format. If you need to inspect a fragment, copy a complete object or array, including its opening and closing punctuation. A comma-separated slice from the middle of an array is not a complete JSON value until it has the appropriate boundaries.
For sensitive payloads, remove values that do not belong in a debugging example. A formatted response may still contain a token, email address, or internal identifier. If you plan to post an example in a shared issue, prepare a small representative fixture first. Expanding an object in the tree or selecting Minified changes how it is displayed and does not hide its contents.
Pick an output spacing that suits the handoff
Two spaces per level gives nested data some separation without using much horizontal space. Four spaces makes each level easier to distinguish in a small example. The tradeoff appears in deeply nested objects, where longer indentation can push the actual values farther to the right. For a file already used by a team, match the style expected by its formatter or repository.
Minified output removes whitespace added for layout. It keeps spaces and newline escapes that belong inside strings. For instance, the value Spring workshop still has a space between its words. This is useful when the destination wants a compact value or when you need to paste a small example into a single-line field. Check the field’s character limit and whether it expects raw JSON or a string containing JSON. Those two inputs have different quoting requirements.
Reformatting rewrites the parsed value. It can change more than indentation, including how escapes are written and how certain object keys are ordered. If a system requires byte-for-byte input, keep the original. This matters for signed payloads, exact test fixtures, and checksums. Compare parsed data where your task is to check meaning, and compare the original files where the exact source matters.
Inspect a nested path with the tree view
Use the tree when you only need a portion of a large response. The root typically opens to show its first level. Expand the tasks array in the workshop example, then expand its entry 0 to check name and done for the first task. Array indexes start at zero, so entry 1 is the second task. Objects show the count of immediate properties and arrays show the count of immediate items.
For a branch with many entries, choose Show more entries to display the next group. The tree reveals entries in batches, while the formatted text includes the whole parsed value. A missing item in a partially expanded branch may simply be farther down the list. Use the text result or expand more entries before concluding it was absent.
Consider a record with three cases for owner. One record has “owner”: null, another has “owner”: “”, and a third has no owner property. The first explicitly has a null value, the second has an empty string, and the third lacks the property. They can look similar when a screen shows only a blank owner. The tree helps you see which case is actually present in each input.
If your input is an array of flat records and you want to compare one field across every record, try JSON Table Viewer. If you need a CSV file, JSON to CSV is a separate conversion. Check how it represents nested objects or missing values. A useful tree view and a useful table serve different reading tasks.
Fix common parsing errors
A valid object uses double quotes around property names and string values. Single quotes, bare property names, and comments might be allowed in a programming language or another configuration format, but strict JSON rejects them. Check whether the source is JSON or a JavaScript object literal before changing it.
Look for a trailing comma just before a closing brace or bracket. For example, this input fails:
{"name":"Book room","done":true,}
Remove the final comma and run the tool again. If an error reports a position, inspect the surrounding characters and the previous line. A missing comma earlier in a document can make the next property appear as the point where parsing failed.
Quotation marks inside a string need to be escaped. A line break inside a value also needs to be represented using a JSON escape. Be careful when copying from a rich-text editor that turns straight quotes into typographic quotes. A failure caused by one character near the beginning may be easier to fix in the source editor than in a large pasted response.
An unexpected end of input can mean a closing brace or bracket is missing. Check that the copied text includes the whole value. If the file was downloaded or copied from a log viewer, make sure the source did not cut off a long line. A successful parse verifies syntax. It does not verify that a required field is present, that a date follows your application’s convention, or that the payload matches a schema.
Check numbers and duplicate keys before reusing the result
The formatter uses JavaScript’s JSON parser and serialization. Ordinary numbers behave as expected for common inspection tasks. Very large integer identifiers can be rounded when parsed as JavaScript numbers. If your data contains long identifiers and the source expects their exact digits, compare the output with the original before replacing it. Where the data format allows identifiers to be strings, an upstream producer can quote them to preserve the digits.
Duplicate keys deserve a similar check. If the same key appears more than once in an object, the parsed value can keep only the last occurrence for that key. Pretty-printing the result can therefore make the duplicate disappear from view. If you are investigating duplicate properties, inspect the original text directly instead of using the formatted output as evidence of how many times a key appeared.
For an application fixture, check a few types explicitly after formatting. A boolean true is different from a quoted “true”, and a number such as 12 differs from “12”. Syntax can be valid in both cases even when an application accepts only one. Use the tree and the destination’s own validation to check the types that matter.
Verify the output where it will be used
Open the downloaded file or paste the copied result into your editor. Check the beginning and end, then inspect the values you expected to find. If the output is meant for a service, run its normal validation or import workflow before replacing an approved fixture. If you are sending a sample to a colleague, verify that you selected the sanitized version and that it still reproduces the shape you intended to discuss.
Keep the original next to the formatted copy when you need to trace differences. Name the new file after its purpose, such as workshop-payload-example.json. The tree is a practical way to discover where a value lives, and the exported file is ready to reuse once you have checked its syntax, types, and the destination’s requirements.
Trace a misplaced setting in a realistic response
Suppose a test response includes an overall status and a status for each job. Paste this sample into JSON Formatter & Viewer.
{"enabled":true,"jobs":[{"name":"preview","enabled":false},{"name":"export","enabled":"false"}]}
Choose an indented output and expand jobs in the tree. The root enabled is true. Under the first job, enabled is the boolean false. Under the second job, the similarly named value is the string “false”. A quick text search for enabled can land on any of those three entries. Use the path of the intended value, such as the second array item’s enabled, to tell a reviewer which one you found.
If the contract expects a boolean on every job, correct the data at its source or prepare a separate corrected fixture. Reformat the corrected copy and check the second job again. It should now have false without quotation marks in the formatted text. Check that you did not change the root enabled or the name of either job during the edit. Compare selected values after formatting so that a change to indentation does not conceal an unrelated change to the data.
A new job inserted at the beginning of the array shifts the positions of the others. If you report the problem by index, also name the job so a colleague can locate it after the order changes. For a shared issue, include the smallest fixture that preserves the root, the relevant array, and the value with the incorrect type. Mention the expected type independently of the JSON’s ability to parse. That separates a data-contract issue from a syntax error and makes it easier to reproduce the mismatch.