JSON Formatter and Validator

Paste JSON, see immediately whether it is valid, then format, sort or compact it.

Input
Raw JSON
Output
Pretty or minified JSON
Processing
In your browser
Cost
Free · no sign-up
JSON FormatterInputRaw JSONOutputPretty or minified JSON

JSON in

Waiting for input

Reorders the keys of every object, at every depth, so two responses that list their keys differently can be compared line by line. Array order is left alone — in JSON the order of an array is data, the order of an object's keys is not.

Result

JSON

Document contents are never sent to a Nekhen server and never appear in analytics.

Your data is processed locally in your browser and is never sent to Nekhen.

About this tool

Prettify JSON to inspect its structure, or minify it when a destination needs a compact value. Valid syntax does not prove that a payload matches an API schema or contains the right types.

The part that actually costs time is not the formatting; it is finding the mistake. A built-in message like "Unexpected token" does not say where the problem is. This tool translates that into a line and column number, along with a short note about what is most likely missing.


Steps

How to use it

  1. Paste your JSONValidity is checked live as you type.
  2. Read the verdictIf something is wrong, the line and column are named.
  3. Prettify or minifyChoose an indent width of 2 spaces, 4 spaces or a tab.
  4. Sort the keys if you are comparingAlphabetises the keys of every object, at every depth, so two responses that list their keys differently line up in a diff. Array order is left alone.
  5. Browse the structureOpen the tree to walk the document one branch at a time, which beats scrolling a long file to find where a value sits.
  6. Copy or downloadThe result can be copied or saved as a .json file.

Real situations

Common uses

  • Reading an API response that arrives as one long line
  • Confirming a configuration file is valid before deploying it
  • Minifying JSON before pasting it into an environment variable
  • Checking a data structure before sending it to a colleague

Privacy

Files are processed locally in your browser and are never uploaded to Nekhen. More detail on the privacy page.


Common questions

Frequently asked

What causes invalid JSON most often?

Three things: a trailing comma before a closing bracket, property names in single quotes instead of double quotes, and unbalanced brackets. This tool points to the location of all three, with a line and column.

Is key order preserved after formatting?

Not always. This tool parses and re-serializes JSON: integer-like keys can move, duplicate keys keep only the last value, and numbers beyond JavaScript precision can change. Sort keys also deliberately reorders members. Keep the original for signed payloads or exact numeric data.

Can it handle large JSON files?

Yes, up to whatever fits in your browser tab memory. Files of a few megabytes are comfortable; files of tens of megabytes will feel heavy, because the whole document has to be loaded at once.

Is my JSON sent to a server or logged?

No. Validation and formatting run entirely in your browser. Document contents are never sent to Nekhen and never included in analytics — which matters, because API responses often contain tokens and personal data.

More tools

See all tools →

Practical guide

Use this tool in a real workflow