JSON guide

How to format JSON privately on Mac.

JSON formatters are handy, but copied API responses, logs, and configuration can contain customer data, access tokens, or internal fields. A local formatter gives you the same fast cleanup without sending that data through a browser tool.

Published July 10, 2026 · By Ashwani Gupta

Format first, then validate

Pretty-printing adds indentation and line breaks so nested objects and arrays are easy to read. Validation checks whether the input is valid JSON in the first place. Use both steps when a compact API response or log entry is hard to inspect.

If validation fails, read the error near the reported position. The cause is often a trailing comma, an unquoted key, an unescaped character, or a value copied from a JavaScript object rather than JSON.

Use minified and sorted views for different jobs

Minified JSON is useful when a value must fit in an environment variable, a request body, or a compact fixture. Formatted JSON is better for human review. Sorting keys can make two similar payloads easier to compare and reduce noise in diffs.

Those views are transformations of the same data, so a local tool is a good place to move between them without making a copy of a private payload available to another service.

Be deliberate with production data

Before sharing JSON in a ticket, chat, or issue, remove credentials, authentication headers, email addresses, account identifiers, and any other fields your team classifies as sensitive. Local formatting reduces one exposure point, but it does not make the content safe to distribute.

For everyday debugging, keeping the formatter on your Mac means you can inspect the original payload, clean it up, copy only the relevant portion, and return to your work without opening another tab.