# JSON-formatering

> Formatér, validér og minificér JSON online. Tydelige fejl med linje og kolonne, valgfri nøglesortering, 2 eller 4 mellemrum eller tabulatorer. Gratis.

Free tool by Orkosi. Page: https://orkosi.com/tools/json-formatter?lang=da

Indsæt et API-svar eller en konfigurationsfil for at gøre den læsbar, eller minificér den, før du sender den af sted. Hvis JSON er ugyldig, får du linjen og kolonnen med fejlen.

1. Indsæt JSON.
2. Vælg indrykning, eller vælg Minificér.
3. Tryk på Konvertér, og kopiér eller download derefter resultatet.

## Input

| Field | Type | Required | What it is |
| --- | --- | --- | --- |
| `json` | text | yes | JSON. |
| `indent` | "2" \| "4" \| "tab" \| "minify" | no | Indrykning. Default: "2". |
| `sort_keys` | true \| false | no | Sortér nøgler fra A til Å. 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

**Hvad tjekker validatoren?**

At teksten er gyldig JSON i henhold til standarden (RFC 8259): nøgler i citationstegn, ingen afsluttende kommaer og ingen kommentarer. Den første fejl vises med linje og kolonne.

**Hvorfor sortere nøgler?**

Sorterede nøgler gør det muligt at sammenligne to JSON-filer linje for linje, hvilket er nyttigt, når du sammenligner konfigurationer eller snapshots.

**Gemmes min JSON?**

Nej. Den fortolkes i hukommelsen og kasseres, når svaret er sendt.

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