JSON Formatter

Format, validate, minify, and escape JSON with live syntax highlighting

100% free. Runs entirely in your browser - your files and data never leave your device and nothing is uploaded to any server.

Indent
Try:
Input
OutputFormatted
data_object Formatted output will appear here as you type
check_circle 100% free to usecheck_circle Runs locally - no uploadcheck_circle Format, validate, minify, escape

About this tool

JSON is the standard format for API responses and configuration files, and it is almost always delivered as a single unbroken line, because whitespace costs bandwidth and machines do not need it. Formatting adds indentation and line breaks so a human can actually read the structure; validating confirms the syntax is legal before you waste time debugging the wrong thing. The format itself is deliberately small: an object in curly braces with double-quoted keys, an array in square brackets, and six value types - string, number, boolean, null, object and array. That strictness is what makes JSON portable, and also what trips people up, because the rules are narrower than they look. Trailing commas are invalid. Keys must use double quotes, never single. Comments are not allowed at all. This tool formats, validates and minifies entirely in your browser, so API keys and customer records inside a payload never leave your machine.

Workflow

Clean up and validate API data

  1. 1Format the JSONMake it readable and catch syntax errors.You are here
  2. 2Convert if neededMove between JSON, XML, YAML or CSV.Open
  3. 3Compare versionsSee exactly what changed.Open
  4. 4Test the requestSend it and inspect the response.Open

How to use this tool

  1. Paste your JSONDrop in the raw response or file contents. It does not matter whether it is minified or already indented.
  2. Format itThe structure is re-indented so nesting is visible at a glance, and the collapsible tree view lets you fold sections you are not interested in.
  3. Read any error reportedIf the syntax is invalid, the position of the problem is shown. That is normally within a character or two of the real mistake.
  4. Copy or minifyTake the formatted version for reading and debugging, or minify back to one line for production use where size matters.

Key features

  • Turns an unreadable single-line payload into something you can actually navigate.
  • Validates syntax immediately, so you find the missing comma instead of guessing why an API call fails.
  • Minifies as well as formats, so the same tool covers both debugging and shipping.
  • Runs entirely in your browser - API keys, tokens and personal data in a payload are never transmitted.
  • Handles large payloads without a size limit imposed by a server.

Common uses

  • Reading an API response while debugging an integration.
  • Checking a package.json, tsconfig.json or CI configuration file before committing it.
  • Validating a payload before sending it, to rule out syntax as the cause of a 400 error.
  • Inspecting a webhook body that arrived as one long line in a log.
  • Minifying a configuration file to reduce bundle size.

Tips for better results

  • Read the reported error position first. JSON parsers report where parsing became impossible, which is usually just after the actual mistake.
  • A missing or extra comma is by far the most common error. Check the line above the one reported, not just the one named.
  • If your JSON comes from JavaScript, keys may be unquoted or single-quoted - both are valid JavaScript and invalid JSON.
  • For files that need comments, you probably want JSON5 or YAML. Standard JSON has no comment syntax and never will.
  • Use the tree view for deeply nested data. Counting brackets by eye is what causes the mistakes in the first place.

Mistakes to avoid

  • Leaving a trailing comma after the last item. Legal in JavaScript, illegal in JSON, and the single most common cause of parse failures.
  • Using single quotes around keys or strings. JSON requires double quotes for both.
  • Adding // or /* */ comments. JSON has no comment syntax, so any comment makes the whole document invalid.
  • Writing NaN, Infinity or undefined as values. None of them exist in JSON - use null or a string.
  • Wrapping numbers in quotes by accident, which turns 42 into the string "42" and breaks type checks downstream.
  • Copying a JSON fragment out of a log that truncated it, then debugging syntax that was never complete.

Supported formats

  • JSON

Available options

  • Format
  • Minify
  • Validate

Frequently asked questions

Paste your JSON above and it is indented and validated immediately. Nesting becomes visible, the tree view lets you collapse sections, and any syntax error is reported with its position.

Yes - no account, no size cap and no paid tier. Everything runs locally in your browser.

No. Parsing, formatting and validation all happen in your browser using its own JSON engine. This matters because API payloads routinely contain tokens, keys and personal data - none of it is transmitted.

It is flagged as invalid with the position where parsing failed. Note that the real mistake is often slightly before that point - a missing comma at the end of one line is reported when the parser reaches the next.

Formatting adds indentation and line breaks for humans. Minifying strips every unnecessary character to make the payload as small as possible for transmission. The data is identical either way - only the whitespace differs.

The usual culprits are a trailing comma after the last element, single quotes instead of double, an unquoted key, or a comment. All four are valid JavaScript and none are valid JSON.

No. The specification has no comment syntax, so any // or /* */ makes the document invalid. If you need commented configuration, use JSON5, JSONC or YAML instead.

Six: string, number, boolean, null, object and array. There is no date type - dates are conventionally written as ISO 8601 strings - and no support for NaN, Infinity or undefined.

No. Only whitespace is added or removed. Keys, values, types and ordering are exactly as they were.

Yes, within your browser's memory. Multi-megabyte payloads format fine; extremely large files may be slow to render in the tree view simply because of how many nodes are drawn.

People also search for

  • json formatter online free
  • json validator
  • json beautifier
  • json pretty print
  • json minifier
  • format json vscode
  • why is my json invalid
  • json viewer tree

Useful in

Related guides