Skip to main content
Develop Tools
← Return to usage guide

JSON Formatter, Minifier, and Syntax Checker | Comprehensive Guide to Usage, Settings, and Troubleshooting

When JSON cannot be read, do not scan the entire file and guess; start with the first line and column where the parser stopped. The displayed location may be where parsing could no longer continue, not the cause itself.

A diagram of passing JSON to a Parser and branching to Valid or an Error with line and column information
A diagram of passing JSON to a Parser and branching to Valid or an Error with line and column information

Format and syntax-check JSON

Paste the current JSON, confirm that it is valid Strict JSON, then format it or compress it to one line.

Open JSON formatting/compression/syntax checking tool

Conclusion: Start at the first error position and inspect back to the preceding token

The current tool's custom parser converts the error index to a line and column and displays an excerpt of the relevant line and ^. "Move to error location" selects the characters in the input field.

With a missing comma, parsing may stop at the next key; with a missing brace, it may stop at the end of the input. Check not only the displayed character but also the preceding value, comma, quote, brace, and bracket.

Common errors and where to check

Error candidatesCheck pointsFix strategy
Missing commaBetween the previous value and the next keyAdd one between members
Trailing commaImmediately before } or ]Remove only the final comma
Missing braces or bracketsInput ending and nestingCheck the matching closing symbol
Missing QuoteString start and endMatch double quotes
Invalid EscapeImmediately after a backslashCorrect it to an escape allowed in JSON
Missing colonImmediately after the Object KeyPlace : between the key and value

How to fix without increasing errors

  1. Duplicate the original JSON.
  2. Check the first Error location and the immediately preceding Token.
  3. Fix only one location and check syntax.
  4. If the following error occurs, repeat the same sequence.
  5. Format it after it becomes Valid, then recheck the bracket hierarchy.

What can be checked with DevelopTools' JSON formatter

The current tool parses pasted JSON or one .json file with its own strict JSON parser. It supports formatting, minifying to one line, and syntax checking. On errors, it displays the line and column, an excerpt of the relevant line, a caret, and a button to move to the location in the input.

FunctionSupport in the current Tool
InputPaste, select a .json file, drag & drop one file
plastic surgery2, 4, or 8 spaces or tabs; LF or CRLF; and a trailing newline
verificationStrict JSON, line and column, excerpt and caret, duplicate key warnings
outputCopying, UTF-8 JSON saving, file naming, and input/output size
PreserveLarge integers, exponential notation, escaped string tokens, and duplicate keys
UnsupportedJSONC / JSON5, automatic repair, comment removal, quote repair, key sorting, and unescaping

Even when an Error is found, the content is not repaired automatically. Check the cause, correct the input, and run "Syntax Check" again. Even if the root is not an Object, Array, String, Number, true, false, and null can be validated as JSON Text.

Common procedure for validating as Strict JSON

Based on RFC 8259, enclose Object Names and Strings in Double Quotes, and place Commas only between Members or Array elements. Comments, Single Quotes, Unquoted Keys, and Trailing Commas are not standard JSON.

First, enter the original data without modifying it and use Syntax check to identify the first error location. Fix the area around the error one location at a time and check again; format or minify only after it is valid. Bulk-replacing multiple locations based on guesses risks changing symbols inside strings.

  1. Paste JSON or load one .json file.
  2. Run syntax checking and check the location indicated by the line, column, and caret.
  3. Compare with the original specification, fix one location, and check again.
  4. After it becomes Valid, choose indentation, line endings, and a trailing newline.
  5. Recheck the output, then copy it or save it as JSON under a different name.

Syntax checking confirms that it can be read as JSON. Validate business structure, such as required Properties, value types, and ranges, separately with JSON Schema.

Do not confuse formatting, minification, validation, and repair

processingpurposeEffect on data
syntax checkCheck whether it can be parsed as Strict JSONDo not modify the input
Format / Pretty PrintUse line breaks and Indent to make the hierarchy easier to readChange formatting whitespace
Compression / MinifyConvert to one line by removing formatting whitespaceSeparate from gzip and Brotli
Automatic repairInfer and fix broken syntaxNot supported by the current Tool
Schema validationCheck Properties, types, and constraintsRole of the JSON Schema Validation Tool

Formatting or minification cannot be applied to Invalid JSON. Fix the syntax first, then verify that the converted JSON can also be parsed again.

Notes for handling confidential and large JSON

Input JSON, selected files, and processing results are parsed in the browser and are not sent to the DevelopTools server or external APIs. LocalStorage stores only display settings such as indentation, theme, font, and editor size; it does not store input content or processing history.

Processing is separated from the UI thread by prioritizing Web Workers. Syntax highlighting in the editor is omitted for more than 500,000 characters, but formatting, minification, and validation continue. Because all text, syntax trees, and output are retained in memory, the processable size depends on device and browser memory.

  • Mask API keys, access tokens, cookies, and personal information before sharing.
  • Try large files incrementally using copies, and close other heavy tabs
  • Even if color coding disappears, check the error display and conversion result
  • Do not overwrite the original file; save under a different name and compare differences

Primary sources for JSON specifications and commands

Check JSON grammar against RFC 8259, JavaScript APIs against MDN, JSONC against official Visual Studio Code documentation, and jq options against the official jq Manual. JSON.parse error text differs by runtime, so treat “Unexpected token” in the article as a representative term.

Example: Fix JSON with a missing closing curly brace

Use input where an object is not closed, such as {"name":"Alice","age":20. Preserve the original data before working, and if it contains sensitive values, verify it using a copy intended for sharing.

Compare the input-ending error with the start of the object and add }. Finally, verify valid syntax, the two keys, number values, and that there are no extra trailing characters, then confirm again that the error is gone.

  1. Enter the target JSON and run a syntax check first.
  2. Check the character indicated by the line, column, and caret together with the surrounding structure.
  3. Fix one cause and check again.
  4. After it becomes Valid, format or minify it as needed.
  5. Save the result under a different name and verify that it can be loaded at its destination.

Keeping the JSON from before and after the fix lets you use a text diff to check for value changes beyond the intended syntax correction.

Frequently asked questions

Is the JSON I enter sent to the server?
It is not sent. Input, file loading, parsing, formatting, minification, copying, and saving are processed in the browser. Only display settings remain in LocalStorage.
Can syntax errors be repaired automatically?
No. The user corrects input using the row, column, and relevant location as clues, then checks syntax again. Its role is separate from guess-based automatic repair.