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 in
Waiting for inputReorders 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
JSONBrowse the structure
Only the first part of the document is shown. Very large files are cut off here so the page stays responsive; the text output above is always complete.
Download complete
Your JSON file has been saved to this device.
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
- Paste your JSONValidity is checked live as you type.
- Read the verdictIf something is wrong, the line and column are named.
- Prettify or minifyChoose an indent width of 2 spaces, 4 spaces or a tab.
- 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.
- 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.
- 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
You might also need
Practical guide