Skip to content
Expensico

JSON Formatter

Format, beautify and minify JSON with configurable indentation, key sorting and precise error locations. Safe for tokens — nothing leaves your browser.

Runs in your browser. Everything you enter stays on your device. Nothing is sent to a server.

How to use the JSON Formatter

  1. Paste JSON, open a .json file, or edit the example.
  2. Choose Beautify for readable output or Minify for the smallest size.
  3. Pick an indentation and optionally sort keys alphabetically.
  4. Copy or download the result. Errors are shown with the exact line and column.

What a JSON formatter does

APIs and logs usually emit JSON on a single line to save space. A formatter parses that JSON and re-prints it with consistent indentation and line breaks so you can read the structure. Because the text is fully parsed first, formatting also validates it: if anything is wrong, you get an error instead of a misleading result.

Is it safe to paste tokens or customer data?

Yes. Formatting runs entirely in your browser with the built-in JSON.parse and JSON.stringify. Nothing you paste is sent to a server or stored. For JWTs, use the JWT decoder.

Things that look like JSON but aren't

  • Trailing commas after the last item: [1, 2,]
  • Single-quoted strings or unquoted keys: {'a': 1}, {a: 1}
  • Comments, undefined, NaN or functions

Example

Input:

{"id":7,"tags":["a","b"],"ok":true}

Beautified with 2 spaces:

{
  "id": 7,
  "tags": [
    "a",
    "b"
  ],
  "ok": true
}

Frequently asked questions

Does sorting keys change my data?

No. JSON objects are unordered by definition, so sorting keys only changes presentation. Array order is never changed.

How large a file can I format?

Files of tens of megabytes work in most desktop browsers. Very large files may be slow on phones.

Are big numbers preserved?

JavaScript numbers are precise to about 15–16 significant digits. Integers larger than 9,007,199,254,740,991 lose precision when parsed — keep such IDs as strings.

Is what I enter stored or sent anywhere?

No. Calculations and processing happen in your browser. Nothing you type is sent to our servers. Some tools remember your last input in this browser's local storage for convenience; you can clear it at any time.