All tools

15 / JSON

JSON Formatter & Validator

Validate JSON locally, format it for review, minify it for transport, and inspect a readable expandable tree.

LiveWebmaster & ContentRuns in your browserUpdated October 2026
15Web

Valid JSON

Structure parsed locally
root {4}
toolUtility Hub
readytrue
categories [2]
0money
1writing
meta {1}
version2

The field guide

Make the data readable before it breaks something.

JSON is compact by design, which makes it useful for systems and occasionally painful for humans. One missing comma or quote can stop a request, configuration file, or data export from working. This formatter validates pasted JSON in the browser, presents a readable indented version when it is valid, highlights a syntax message when it is not, and offers a concise minified form for situations where whitespace needs to be removed.

How it works

Paste a JSON object or array into the source panel. The tool attempts to parse the text using the browser’s JSON parser. A successful parse creates a formatted version with consistent indentation, a minified version with unnecessary whitespace removed, and an expandable tree view. If parsing fails, the result state reports the browser’s syntax message and keeps the original input untouched so you can correct the source instead of losing it.

Formula & logic

Validation follows standard JSON parsing rules: property names and string values require double quotes; objects use braces; arrays use brackets; commas separate entries; and values must be valid strings, numbers, booleans, null, arrays, or objects. JSON is not JavaScript. Comments, trailing commas, single-quoted strings, undefined values, and functions may work in a JavaScript file but are not valid JSON. Formatting changes whitespace only after a successful parse.

Useful in practice

Use it to inspect an API response, clean a configuration fragment, prepare structured data for a CMS, check a JSON-LD block, or reduce a payload before transport. The tree view is helpful when a nested response hides the property you need. For confidential information, remember that this version works locally in the page. Still avoid pasting secrets into any web tool unless you understand the environment and your organisation’s policy.

Worked example

An operations engineer receives a webhook payload that fails with HTTP 400. Pasting it into the formatter exposes a missing comma after "eventId": 483921 and highlights line 4. After adding the comma, validation succeeds and formatting reveals a "charges" array with two entries: USD 49.95 and USD 12.50, plus "total": 62.45. The formatted structure also reveals an unexpected "debug": true flag and makes nesting easy to compare with the documented request example. The engineer checks that 49.95 + 12.50 equals 62.45, confirms the currency is consistently USD, and redacts "customerEmail" before sharing the sample. The result means the payload is syntactically valid; it does not prove that the endpoint accepts the field names, that the amounts are authorized, or that the webhook came from a trusted sender. Those checks require the API specification and server logs.

Common mistakes to avoid

Common errors include pasting JavaScript object syntax instead of JSON, such as single-quoted keys, trailing commas, comments, or undefined. Another frequent input error is copying smart quotation marks or invisible characters from a document, which can make an otherwise correct payload fail validation. Large request samples are sometimes truncated during copying, leaving an unclosed bracket or string. Readers also misinterpret a successful validation: it confirms JSON grammar, not that required API fields, data types, authentication, or business rules are correct. Conversely, a formatter's error line often identifies where parsing became impossible, not necessarily the original mistake; inspect the preceding token and surrounding nesting.

Before you rely on the result

  • Remove or mask secrets and personal identifiers before pasting.
  • Validate first; then inspect the highlighted line and preceding token.
  • Confirm brackets, array lengths, and totals match the expected payload.
  • Compare field names, types, and required values with endpoint documentation.

Accuracy note

The validator follows the browser implementation of standard JSON parsing. It does not validate an API’s business rules, a JSON Schema, required fields, security, or the semantic correctness of a JSON-LD document. Test data against the receiving service when the result matters.

Questions people ask

Why are trailing commas rejected?

Trailing commas are allowed in some JavaScript contexts but are not part of the JSON data format.

Does minifying change JSON values?

No. For valid JSON it removes non-essential whitespace while preserving the parsed data structure and values.

Can I safely paste a production API payload into an online formatter?

Treat any third-party formatter as an untrusted destination unless its privacy practices and retention behavior meet your team's requirements. Remove or mask credentials, session tokens, passwords, emails, addresses, and unique identifiers first. For sensitive payloads, use an approved local or self-hosted tool.

Why can valid JSON still produce an API error?

JSON validation checks only structural grammar: quotation marks, commas, brackets, and valid values. APIs may also enforce schemas, required fields, enums, numeric ranges, content types, version-specific rules, and authentication. Compare the formatted payload with the endpoint documentation and the response body's error details.