# JSON formatter

> Format, validate and minify JSON online. Clear error messages with line and column, optional key sorting, 2 or 4 spaces or tabs. Free.

Free tool by Orkosi. Page: https://orkosi.com/tools/json-formatter

Paste an API response or a config file to make it readable, or minify it before shipping. If the JSON is broken, you get the line and the column of the mistake.

1. Paste the JSON.
2. Choose the indentation, or Minify.
3. Press Convert, then copy or download the result.

## Input

| Field | Type | Required | What it is |
| --- | --- | --- | --- |
| `json` | text | yes | JSON. |
| `indent` | "2" \| "4" \| "tab" \| "minify" | no | Indentation. Default: "2". |
| `sort_keys` | true \| false | no | Sort keys A to Z. Default: false. |

## Example

Input:

```json
{
  "json": "{\"name\":\"Orkosi\",\"plans\":[{\"id\":\"starter\",\"price\":19},{\"id\":\"pro\",\"price\":49}],\"live\":true}"
}
```

Result:

```json
{
  "valid": true,
  "type": "object",
  "output": "{\n  \"name\": \"Orkosi\",\n  \"plans\": [\n    {\n      \"id\": \"starter\",\n      \"price\": 19\n    },\n    {\n      \"id\": \"pro\",\n      \"price\": 49\n    }\n  ],\n  \"live\": true\n}",
  "bytes_in": 91,
  "bytes_out": 159
}
```

## Run it

It needs a free Orkosi account, nothing else. No credits are used.

- **A person**: open the page, enter an e-mail once, use the tool.
- **Claude or ChatGPT**: add the Orkosi connector `https://orkosi.com/api/v1/public/mcp` and sign in, or create the free account on the sign-in page. Then call `orkosi_run_free_tool` with `{ "tool": "json-formatter", "input": { … } }`.
- **Any agent or program that can make an HTTP request**:

  1. Once, create the account: `POST https://orkosi.com/api/v1/public/signup` with `{ "name": "…", "email": "…", "terms_accepted": true }` and no key. Ask the person for the e-mail and their agreement to the terms first. The answer carries `data.api_key`, shown once.
  2. Run the tool:

```bash
curl -X POST https://orkosi.com/api/v1/public/tools/json-formatter/run \
  -H "Authorization: Bearer $ORKOSI_API_KEY" -H "Content-Type: application/json" \
  -d '{"input":{"json":"{\"name\":\"Orkosi\",\"plans\":[{\"id\":\"starter\",\"price\":19},{\"id\":\"pro\",\"price\":49}],\"live\":true}"}}'
```

The answer is `{ "data": { "tool": "…", "result": { … } } }`. A call without a key is answered 401 with the signup steps as data.

## Questions

**What does the validator check?**

That the text is valid JSON by the standard (RFC 8259): quoted keys, no trailing commas, no comments. The first error is reported with its line and column.

**Why sort keys?**

Sorted keys make two JSON files comparable line by line, which helps when you diff configs or snapshots.

**Is my JSON stored?**

No. It is parsed in memory and discarded when the answer is sent.

All free tools: https://orkosi.com/tools.md
