Skip to content
Developer

JSON formatter, validator and minifier

Make a compact JSON response readable, remove formatting for a single-line copy, or find a syntax error. Paste the JSON and choose the layout you need.

Runs in your browser — your input is not uploaded to ToolsNow.

JSON
0 chars0 words0 lines
Formatted JSON
0 chars0 words0 lines

How to use

  1. Paste the JSON value. Include the JSON itself, without a JavaScript variable assignment or Markdown code fences.
  2. Choose the output. Beautify adds line breaks and your chosen Indent. Minify puts the parsed value on one line. Sort keys alphabetically also applies to nested objects.
  3. Review and copy. Check any error message and the structure counts, then use Copy result or Download. Keep a copy of the source when number precision or duplicate keys matter.

Questions

Why is valid JavaScript rejected?

JSON has stricter syntax. Keys and strings need double quotes, and trailing commas, comments and values such as undefined are not allowed. For example, {"name":"Ada"} is JSON; {name: 'Ada'} is not.

Will every error have a line and column?

Only when the browser’s parser provides a location the tool can use. When it reports a character position, the tool converts that into a line and column. Other errors may show only the browser’s message; check the text just before the reported location too.

Can formatting or minifying change a value?

Yes. The tool uses JSON.parse followed by JSON.stringify, rather than editing whitespace alone. Large integers can lose precision: 9007199254740993 becomes 9007199254740992. Duplicate object keys keep only the last value, and number notation and string escapes can change. Store exact identifiers as strings in the source data.

Does Valid JSON mean my API will accept it?

No. It means the syntax parsed. This tool does not check required fields, value types against a schema, or your API’s rules. The key, object and array counts are a structure summary, not an application-level validation.

Is the pasted JSON uploaded?

Parsing and formatting happen in your browser without uploading the JSON. Page analytics are separate from that local processing; see the site’s privacy policy for those details.

Examples and checks

Paste JSON and choose an indentation size to make it easier to read, or Minify to remove formatting spaces. The check catches syntax errors, not whether the data is right for another application.

A valid object

Input or situation
{"name":"Ada","active":true}
Result
{ "name": "Ada", "active": true }

Indentation changes the presentation while keeping these values intact. JSON requires double-quoted property names.

A trailing comma

Input or situation
{"active":true,}
Result
Validation error

A comma must be followed by another member. Remove the comma before the closing brace.

Before you use the result

Published by ToolsNow. How tools and sources are checked · Report a problem

Read more

Related tools