JSON Formatter and Validator
Format, validate, beautify, and minify JSON data with a collapsible tree view and line-and-column error detection.
JSON Formatter and Validator tool
Example
Input: {"name":"Ada","age":36,"langs":["en","fr"]} then click Format
Result: 9 lines with 2-space indentation: { / "name": "Ada", / "age": 36, / "langs": [ / "en", / "fr" / ] / }
The JSON is parsed and re-serialized with one key or array item per line. Minify does the reverse and Validate only reports "Valid JSON" or the error line and column.
- Paste your raw or minified JSON data into the input text area.
- Click Format to validate and pretty-print your JSON with 2-space indentation.
- Click Show Tree View to explore nested data in an interactive, collapsible tree.
- Click Minify for compact output, or Validate to simply check that the JSON is valid.
- Review any validation errors, which include the line and column of the problem.
- Click the copy button to copy the formatted JSON to your clipboard.
Understanding JSON Formatting and Validation
A JSON formatter takes compact or messy JSON and lays it out with one key or value per line, indented two spaces per level. This one also checks that the JSON is valid. If it is not, you see the line and column where it breaks.
JSON (JavaScript Object Notation) is the text format most web APIs use to send data. It is strict. Keys need double quotes, single quotes are not allowed, and a comma after the last item is an error. A missing comma in a long one-line API response is almost impossible to spot by eye. Paste it here, click Format, and the error message takes you to the spot.
There are four actions. Format pretty-prints the data. Minify strips out every space and line break. Validate only checks the syntax and reports Valid JSON or the error. Show Tree View opens a folding outline of objects and arrays, with an item count on each branch. The top two levels start open, so you can drill into deep data one branch at a time. Line counts and sizes appear for both the input and the output.
Everything runs in your browser, so tokens or customer data in a payload stay on your device. To compare two versions of a response, use the JSON Diff Viewer. If your file has comments, as many config files do, the JSON Minifier can strip them first.
Sources
Frequently Asked Questions
Related Tools
JSON to CSV Converter
Convert a JSON array of objects to CSV with automatic column headers, and convert CSV back to JSON in the same tool.
Developer ToolsCSV to JSON Converter
Convert CSV data to a JSON array of objects with header mapping and automatic comma, semicolon, or tab detection.
Developer ToolsJavaScript Minifier
Minify JavaScript by removing whitespace, line breaks, and comments for smaller files, without renaming your code.
Developer ToolsJWT Decoder
Decode JSON Web Tokens to inspect header, payload, and signature without needing the secret key.
Developer Tools