workspacereference / tools / guidesPUBLIC TOOLS
Portstone Developer Tools
Browse ▾
LOCAL TOOL / JSON

JSON formatter

Paste a JSON value and format it. Syntax errors are reported directly. Nothing is uploaded.

01 / JSON

Format and validate

Executed in this browser

What the formatter does

The parser uses the browser built-in JSON.parse. The formatter uses JSON.stringify, which prints a valid JSON value with consistent indentation or compact spacing.

This process does not preserve original whitespace or the textual spelling of some numbers. Very large numeric values follow JavaScript number rules. Use a specialized parser when byte-for-byte preservation matters.

Valid JSON is a precise data format: object keys are quoted, trailing commas are not allowed and values such as true and null have lowercase spellings. The formatter checks syntax and adjusts whitespace; it cannot tell whether a key belongs in your application or whether a number is within the accepted range. If you are comparing two documents, inspect their values and structure after formatting instead of treating identical indentation as proof of equivalence.

A practical way to use this page is to write down the behaviour described by “tools json”, then compare it with one observable example. Keep the actual result distinct from the assumption that motivated the test. When something differs, inspect the smallest relevant part before changing other settings.