Every JavaScript developer has logged an object and seen [object Object] staring back at them.
Loading JSON Formatter…
Reveals full object structure instantly
Spot null, undefined, and wrong types
No console.log juggling needed
Works for any JSON data source
Drop the JSON Formatter into any page — blog post, product docs, intranet, school portal — with a single line of HTML. Your visitors get the full tool, processed entirely in their browser. No backend, no uploads, no signup.
Embed code
<iframe
src="https://www.fixtools.io/json/json-formatter?embed=1"
width="100%"
height="780"
frameborder="0"
style="border:0;border-radius:16px;max-width:900px;"
title="JSON Formatter by FixTools"
loading="lazy"
allow="clipboard-write"
></iframe>Attribution-friendly: a small "Powered by FixTools" link appears in the embed footer.
In JavaScript, when you concatenate an object with a string or pass it to a function expecting a string, the engine calls the object's toString() method. The default toString() on plain objects returns "[object Object]". This happens in template literals, string concatenation, and some logging frameworks that stringify their arguments before writing them to a log sink. The actual data is still present in memory; the display mechanism is simply using the wrong serialization method. The fix is to explicitly convert the object to a JSON string before displaying it, so the full structure becomes readable text.
The correct pattern for logging a JavaScript object's complete structure is console.log(JSON.stringify(obj, null, 2)), which converts the object to a formatted JSON string with 2-space indentation. If the object has already been serialized to a JSON string by an API client, a database driver, or a message queue consumer, you already have a raw JSON string that can be copied directly. In either case, pasting the resulting JSON into FixTools produces the full structure with syntax highlighting, making it far easier to identify a field with an unexpected value than reading a dense monospaced console output line-by-line.
Debugging with formatted JSON delivers the most value when data has more than two or three nesting levels. A flat object with five keys is easy to read in any form. An API response with arrays of objects, each containing nested sub-objects and further arrays, is nearly impossible to read unformatted. Proper indentation aligns each key to its nesting level, making parent-child relationships between fields visually obvious. It becomes straightforward to confirm that a specific path like response.data.items[0].user.address.city exists, has the right type, and contains the expected value without writing a test first.
Several spec edge cases surface specifically during debugging. JavaScript serialises Date objects to ISO 8601 strings via the Date.prototype.toJSON method, but the parsed JSON does not contain a Date type, so the round-tripped value is a string and any code expecting a Date instance throws. Large integers beyond Number.MAX_SAFE_INTEGER (2^53 - 1) lose precision silently: a Twitter or Stripe identifier like 9007199254740993 becomes 9007199254740992 when round-tripped through JSON.parse and JSON.stringify. Trailing commas, comments, and NaN are not allowed in strict JSON, so when JSON.stringify(obj) silently omits a field, the source object likely had undefined, a function, or a Symbol value at that key, none of which are representable in JSON. Knowing these edge cases turns mysterious bugs into one-line diagnoses.
Debugging workflows benefit from pairing the formatter with structured logging conventions. Pino, Bunyan, and Winston emit one JSON object per log line, where each object includes a timestamp, log level, message, and arbitrary context fields. To investigate a specific request, copy the relevant log lines, paste them into FixTools one at a time (each line is its own document), and read the formatted view of each. For Kubernetes pods, kubectl logs piped through grep extracts the lines of interest, and FixTools formats the JSON payload of any single line for human inspection. This pattern scales from local development to production incident investigation because the same log format works at every tier, and the debugging tool stays the same regardless of where the log originated.
Paste any JSON string you are trying to debug here. The formatter reveals the full structure with indentation so you can trace the exact field causing an issue.
Step-by-step guide to format json for debugging, see past [object object]:
Get the JSON string
Serialize the object you are debugging with JSON.stringify(obj) in your console, or copy the raw JSON directly from a log file, API response capture, or network request body. If the value is already a JSON string, copy it as-is. You do not need to strip surrounding quotes, FixTools accepts both raw strings and JSON text.
Paste into FixTools
Open FixTools in your browser and paste the JSON string into the formatter input area. The input accepts any valid JSON, regardless of how it was captured. If the string was logged with extra surrounding text, strip that text first so the input starts with an opening brace or bracket.
Click Format
Click the Format button. FixTools validates the JSON, then re-serializes it with 2-space indentation and syntax highlighting. If the JSON is invalid, the error position is shown instead. If the JSON is valid, the structured output appears immediately, coloured by token type so you can distinguish strings, numbers, booleans, and null at a glance.
Inspect the structure
Scroll through the formatted output to find the field or value causing the bug. Use Ctrl+F or Cmd+F to search for a specific key name. Count indentation levels to understand nesting depth. Look for null, missing keys, or unexpected value types. The visual structure makes parent-child relationships between keys immediately obvious in a way raw minified text cannot.
Common situations where this approach makes a real difference:
React developer
Formatted JSON makes null values and missing fields visible at a glance.
Node.js developer
Extra nesting layers are easy to miss in minified output but obvious when formatted.
Backend developer
Parallel error fields in API responses are frequently missed without formatting.
Junior developer
Formatting JSON is one of the first debugging skills developers learn when working with APIs.
Get better results with these expert suggestions:
Use console.log(JSON.stringify(obj, null, 2)) instead of console.log(obj)
console.log(obj) in browsers shows an interactive expandable object that reflects the live state of the object at the time you inspect it, not the state at the time of logging. This causes a confusing debugging experience where an object looks different when expanded versus when it was first logged. JSON.stringify(obj, null, 2) captures the exact state at log time as an immutable string, preventing this mismatch and giving you a reliable snapshot for debugging.
Breakpoint and JSON.stringify in DevTools
When paused at a breakpoint in Chrome or Firefox DevTools, type JSON.stringify(variableName, null, 2) in the console to see the full serialized state of any variable currently in scope. This is faster than stepping through the watch panel for deeply nested objects. You can also copy the output directly from the console to paste into FixTools for a syntax-highlighted, searchable view.
Check for undefined vs null carefully
JSON.stringify converts undefined values to null in arrays but omits keys with undefined values from objects entirely. If a field you expect is missing from your formatted output, the original object likely had that key set to undefined rather than null. A key present with a null value appears as null in the output. A key set to undefined is simply absent. This distinction is critical when debugging missing data bugs in JavaScript applications.
Log request and response together for API debugging
When debugging an API integration, log both the outgoing request body and the incoming response body as JSON strings using JSON.stringify. Format both in FixTools and compare them side by side. Field names that change between the request and response (such as camelCase in the request becoming snake_case in the response) are easy to miss in raw text but obvious when both sides are formatted and you can scan them visually.
More use-case guides for the same tool:
Other tools you might find useful:
Open the full JSON Formatter — free, no account needed, works on any device.
Open JSON Formatter →Free · No account needed · Works on any device