JSON Formatter

Make JSON readable with indents, or squeeze it into a single line.

Files never leave your device — everything runs in your browser

An API response or a log entry often arrives as one long line. The formatter lays it out with indents of 2 or 4 spaces or tabs, so the structure is visible at a glance. The reverse works too: minify takes out every space and line break, and the JSON gets smaller — handy for config fields, URL parameters and network traffic.

Sort keys arranges keys alphabetically at every level. That makes it easier to compare two versions of a config, review a diff or find a field in a big object. Array order is never touched, because it carries meaning.

Validation comes along: if the JSON is broken, you see the line and column with a plain explanation and can fix it with one click. Large integers and any language are kept exactly as they were.

Nothing is uploaded: parsing and conversion run inside your browser, so API responses, CRM exports and files with personal data stay on your device.

Options

How to format JSON in 3 steps

  1. 1

    Load the JSON

    A file, pasted text or the Sample.

  2. 2

    Pick the format

    2 or 4 spaces, tabs or one line; sort keys if needed.

  3. 3

    Copy or download

    The result is ready in the preview.

Frequently asked questions

Load it here and pick a 2- or 4-space indent; the formatted JSON is ready at once.
Choose one line under Indent — spaces and line breaks are removed and the data stays the same.
No, only the order of keys inside objects. For programs it is the same JSON.
Yes, numbers are written exactly as in the source, without rounding.

Related tools