PrivateCSV

Format, validate and minify JSON

Beautify, validate or minify JSON, with the line of any error.

The result updates as you type. Nothing leaves your browser.

Options

  • Nothing is uploaded
  • Free · no account
  • Tested on 400k-row files

Reference

JSON Formatter: how it works

The tool is above. Below: a short overview, optional step-by-step detail, honest browser limits, and answers to common questions.

Last updated 3 min read

About this tool

PrivateCSV formats JSON as you paste it: choose 2 spaces, 4 spaces or tabs to make it readable, or minify it to one line. Invalid JSON is reported with the line and column of the error, keys can be sorted A to Z, and long numbers such as 64-bit IDs are kept digit for digit. The JSON is parsed by your browser and never sent anywhere, so API responses, tokens and configs stay on your device.

How to check that your file is never uploaded

Read the step-by-step guideHow-to, example and use cases (~3 min)

How to format JSON online

  1. Paste the JSON in the left box, drop a .json file on it, or click Open file.
  2. The formatted JSON appears on the right. If the JSON is invalid, the message gives the line and column to fix.
  3. Pick the indent (2 spaces, 4 spaces, tabs) or Minify, and tick Sort keys if you want a stable order.
  4. Click Copy, or Download to save the result as a .json file.

Example

A minified API response, formatted with 2 spaces.

response.json
{"id":7,"name":"Ana","tags":["vip"]}
formatted.json
{
  "id": 7,
  "name": "Ana",
  "tags": [
    "vip"
  ]
}

When you need it

Read an API response
Responses copied from logs, curl or the browser's Network tab arrive on one line. Formatting them shows the structure at a glance, and the counts tell you how many objects and values it holds.
Find the error in a config file
A missing comma or a trailing comma breaks package.json, tsconfig or a settings file. The validator points to the line and column where parsing stopped.
Shrink JSON before sending or storing it
Minify removes every space and line break that is not inside a string, which makes payloads, fixtures and local storage values smaller.

Private by design

Many online JSON formatters send what you paste to their server. JSON often contains access tokens, customer records or internal settings, so this one parses it with JavaScript in your browser: there is no upload, and the page keeps working offline once loaded.

Numbers are not rounded

JavaScript stores numbers as 64-bit floating point, so a plain JSON.parse turns 12345678901234567890 into 12345678901234567000 and 1.10 into 1.1. In current browsers this formatter keeps the original digits of such numbers, so a reformatted file means the same thing as the original.

Browser and file limits (not a trial)

These are technical limits of running in your browser—device memory, encoding and what this tool does not do. They are not a free trial, account quota or paid plan. There is no subscription.

  • The text box holds up to 20 MB. For bigger files, use a command-line tool such as jq.
  • Strict JSON only: comments, single quotes and trailing commas are reported as errors, not fixed.
  • If a key appears twice in one object, the last value is kept, as JSON.parse does.
  • Older browsers without JSON.rawJSON round numbers longer than 15 to 17 digits, as JavaScript always has.

Frequently asked questions

How do I format JSON online?

Paste the JSON in the box above. It is formatted with 2-space indentation at once; change the indent or click Minify in the options, then copy or download the result.

How do I validate JSON and find the error?

Paste it in the formatter. Valid JSON shows a count of its objects and values; invalid JSON shows the reason and the line and column where the parser stopped, such as a missing comma or an unquoted key.

What does minify JSON mean?

Minifying removes the indentation and line breaks between values, giving the smallest valid JSON on one line. The data does not change: spaces inside strings are kept.

Is it safe to paste JSON with tokens or personal data?

Here, yes: the JSON is processed in your browser and not sent to any server. You can check in the Network tab of the developer tools, or disconnect from the internet after the page has loaded.

Can I sort JSON keys alphabetically?

Yes. Tick Sort keys A to Z: the keys of every object, at every level, are sorted. Arrays keep their order, since the order of items is part of the data.

Related tools

Go further

Your files never leave your device

PrivateCSV runs this tool in your browser. No upload, no account, no trial and nothing to install.