---
title: "JSON Formatter"
description: "Format and minify JSON. Runs in your browser; your data never leaves it."
url: https://sade.dev/en/tools/json-formatter/
lang: en
author: "Muhammet Şafak"
published: 2026-04-01
updated: 2026-08-30
section: Tool
tags: ["json","formatter"]
---

# JSON Formatter

> Format and minify JSON. Runs in your browser; your data never leaves it.

A plain formatter built on `JSON.parse` and `JSON.stringify`. The indent size is
configurable (2 spaces, 4 spaces, or tab). For invalid JSON it returns a clear error
message.

## Where JSON.parse is strict

JavaScript's built-in parser follows RFC 8259:

- **Keys must be double-quoted.** `{name: 'x'}` is invalid; `{"name": "x"}` is valid.
- **No trailing commas.** `[1, 2, 3,]` is rejected.
- **No comments.** `// note` or `/* ... */` is not accepted.

These three are where developers get tripped up most often. If you need all three,
you're really using JSON5. JSONC adds comments, but trailing commas are optional there
and unquoted keys are still not allowed — either way, this tool is for strict JSON.

## Minify vs Format

- **Format** — for readability. Meaningful in diffs.
- **Minify** — to shrink payload size. For HTTP bodies or WebSocket frames.

Both represent the same data; the only difference is whitespace.

## Privacy

The JSON you paste is processed entirely in your browser. It is never sent to sade.dev's
backend or any other service.
