Format, validate, and minify JSON online — free and private
JSON is everywhere — API responses, configuration files, log lines, and saved settings — but it is often delivered as one dense, unreadable line. This free JSON formatter and validator turns that blob into clean, indented, easy-to-scan text, flags any syntax errors with their line and column, and can compress valid JSON back down to the smallest possible size. Everything happens inside your browser using its built-in JSON engine, so your data — even private API keys or customer records — is never uploaded to a server.
How to format and validate JSON
- Paste your JSON Type or paste your JSON into the input box on the left. It can be a single minified line or already partly formatted.
- Choose an indentation Pick 2 spaces, 4 spaces, or tabs for how the formatted output should be indented.
- Click Format, Minify, or Validate Format pretty-prints the JSON, Minify compacts it to one line, and Validate just checks whether it is well-formed.
- Fix any errors If the JSON is invalid, read the error message and the reported line and column, correct the problem, and run it again.
- Copy the result Use the Copy button to put the formatted or minified output on your clipboard, ready to paste anywhere.
Format vs. minify: which do you need?
Formatting (or beautifying) adds indentation and line breaks so a human can read and debug the structure — ideal while you are inspecting an API response or editing a config file by hand. Minifying strips every unnecessary space and newline to produce the smallest valid JSON, which is what you want before storing it, embedding it, or sending it over the network where bytes matter. Both operations parse your input first, so either button will also tell you instantly if the JSON is malformed.
Common use cases
- Debugging APIs. Paste a raw response to see its structure and spot missing or unexpected fields.
- Editing config files. Beautify
package.json,tsconfig.json, or any settings file before making changes. - Validating before deploy. Catch a stray comma or unquoted key that would otherwise break your build or app at runtime.
- Shrinking payloads. Minify JSON to reduce file size for embedding in code or transmitting to a service.
- Learning JSON. See how nesting, arrays, and objects are laid out with proper indentation.
Understanding JSON syntax errors
Most invalid JSON comes from a handful of mistakes: a trailing comma after the last item, a missing comma between two items, keys that are not wrapped in double quotes, single quotes used instead of double quotes, or an unbalanced bracket or brace. When validation fails, the tool reports the parser’s message along with the line and column of the first problem whenever the browser provides them, so you can jump straight to the offending character and fix it. Need other text tools? Try the Word Counter, Case Converter, or Password Generator.