# JSON Formatter — JSON formatter and validator for Mac

Format, minify and validate JSON, with the exact line and column of any mistake. Part of OneMacTools, 151 private tools in one native Mac app (macOS 26 or later); category: Utilities. Runs on your Mac; nothing is uploaded.

Paste JSON from an API, a log or a config file to pretty-print it with 2 spaces, 4 spaces or tabs, minify it to one line, or just check it. Keys stay in their original order unless you choose to sort them, and numbers and strings are kept exactly as written. When something's wrong, you get the line and column and a plain explanation, such as a trailing comma, single quotes or a missing bracket. Nothing is sent to a website.

Page: https://www.onemactools.com/tools/json-formatter · Download: https://www.onemactools.com/download · Pricing: https://www.onemactools.com/pricing

## How to use it
1. **Paste your JSON.** Paste JSON from an API response, a log or a config file into the box.
2. **Choose the action.** Pick Format to pretty-print it, Minify to squash it onto one line, or Validate only to check it.
3. **Click Format.** Or press Command-Return. If the JSON is valid, the result appears below in monospaced type and is copied to the clipboard, with a summary such as an object with 4 keys, 2 levels deep.
4. **Fix any mistakes.** If it isn't valid, you get the line and column of the problem and a plain explanation, such as a trailing comma or a key in single quotes. Fix it and run it again.

## Options
- **Action:** Format adds line breaks and indentation so it's easy to read. Minify removes all spacing for the smallest size. Validate only checks the JSON and describes it without changing or copying anything.
- **Indent:** Only shown when Action is Format. 2 spaces, 4 spaces or Tab. Match the style of the project you're pasting into.
- **Sort keys A–Z:** Only shown when Action is Format or Minify. Off by default, so keys stay in their original order. Turn it on to sort the keys of every object alphabetically, which makes two files easier to compare.
- **Also save as a .json file:** Only shown when Action is Format or Minify. Also saves the result as Formatted.json or Minified.json in a new dated folder in Downloads › OneMacTools.

## Tips
- Check the line and column in the error first. The mistake is usually just before that point, such as a missing comma on the line above.
- Turn on Sort keys A–Z on both versions before comparing two JSON files, so differences in key order don't get in the way.
- Use Minify before pasting JSON into a request body or an environment variable.
- Click Use as Input to run the result again, for example to minify JSON you've just formatted and edited.
- Comments, trailing commas and single quotes aren't valid JSON. Remove them if the file came from a JavaScript or JSON5 config.

## Questions
**How do I format JSON on a Mac?**
Paste the JSON, leave Action on Format and click Format. The pretty-printed JSON appears below and is copied to your clipboard.

**How do I check if my JSON is valid?**
Choose Validate only and click Format. You either get a summary of the JSON or the exact line and column of the first mistake with an explanation.

**How do I find the error in my JSON?**
Run it through JSON Formatter. The message gives the line and column and says what's wrong, such as “Remove the comma before }” or “Keys must use double quotes”.

**How do I minify JSON?**
Choose Minify and click Format. All spaces and line breaks outside strings are removed and the one-line JSON is copied to your clipboard.

**Does formatting change my numbers or key order?**
No. Numbers and strings are kept exactly as written, and keys stay in their original order unless you turn on Sort keys A–Z.

**Is it safe to paste API keys or private data?**
Yes. The JSON is checked and formatted on your Mac and never sent to a website.

**Why is JSON with comments or single quotes rejected?**
Standard JSON doesn't allow comments, single-quoted strings or trailing commas. Remove them and run it again.
