JSON formatter & validator
Pretty-print, minify and validate JSON with the error line shown.
FreeRuns in your browserNo signupUpdated 2026-10-29
Nothing leaves your browser. Large files are fine; the output is capped only by memory.
Status
Valid JSON
11 values, 2 levels deep
Output size
188 B
+38 bytes vs input
Lines
14
Formatted output
{
"name": "MSH Technologies",
"founded": 2014,
"services": [
"web",
"mobile",
"ai"
],
"office": {
"city": "Hyderabad",
"remote": true
},
"clients": null
}About this tool
How it works and how to read the result.
Need this done for you?
Web app & SaaS development
SaaS products and web apps, from first version to scale.
See the serviceWhat it does
Paste any JSON into the JSON formatter and it is validated and reformatted as you type. Pretty-print with two spaces, four spaces or tabs, or minify to one line for a config field or an HTTP body. An option sorts object keys alphabetically at every level, which makes two exports easy to diff. When the input is invalid you get the line and column of the first problem plus a snippet with a caret under the character, rather than a vague message that differs between browsers.
How to use it
- Paste the JSON into the input box. An API response, a package.json or a config export all work.
- Pick Pretty-print or Minify, and an indent size.
- Tick "Sort object keys" if you want a stable order for comparing files.
- Read the status badge. If it says Invalid, go to the line and column shown, fix it, and the output refreshes.
- Copy the output or download it as a .json file.
How to read the result
The three figures at the top are the status, the output size and the line count. A valid 1.8 KB response that minifies to 1.2 KB has lost about a third of its bytes to indentation, which is worth knowing if you are embedding JSON in a page or a header. A minified file pretty-printed to 240 lines is easier to review.
The status hint shows the number of values and the nesting depth. Depth above six or seven levels usually means a structure that will be awkward to type and to query; flattening it is often the better fix.
On invalid input, read the message and the caret together. "Expected ',' or '}'" at line 12, column 9 almost always means the line above is missing its comma. "Expected a double-quoted property name" at a closing brace means a trailing comma. "Unexpected character '/'" means a comment, which JSON does not allow.
If you need to turn the same data into types, the JSON to TypeScript tool uses the same parser. We build APIs and the apps that consume them as part of web app development.
Questions
Frequently asked.
Why does my JSON fail when it looks fine?
The usual causes are a trailing comma after the last item, single quotes instead of double quotes, an unquoted key, or a comment. JSON is stricter than JavaScript. The error panel points at the exact character, which is usually the comma or quote just before it.
Is my data sent to a server?
No. Parsing and formatting happen in your browser with the built-in JSON engine. Nothing is uploaded or logged, so it is fine to paste API responses or config files that contain private data. Closing the tab clears everything.
Does pretty-printing change the data?
No. Whitespace outside strings has no meaning in JSON, so a formatted and a minified file carry the same values. Sorting keys also keeps every value, only the order changes, which some tools treat as different text in a diff.
Your next move
Like what you see? Tell us about it.
A process that takes too long, a website that undersells you, or an idea ready to take shape. Tell us where you are and we will suggest a useful next step.
India · Working with clients worldwide