All tools

JSON Prettify

JSON Formatter — Format, Validate and Beautify JSON Online

Validate JSON, format it with 2, 4 or 8 spaces, or minify it in your browser.

Upload JSON file

Input JSON
Formatted Output

How to format, validate and minify JSON and fix invalid JSON errors

This JSON formatter turns compact or messy JSON into readable, indented text, checks that it is valid, or squeezes it back into a single line. Paste text or upload a .json file, choose Prettify, Minify or Tree, and the result appears below your input, or the parser error does if something is wrong. It runs in your browser and follows strict JSON, the same rules an API or a JSON.parse call applies.

Format and beautify JSON with 2, 4 or 8 spaces

Paste JSON into Input JSON, or use Upload JSON file for a .json or .txt file, and Formatted Output fills in at once in Prettify mode. Indent offers 2, 4 or 8 spaces and starts at 2. Each key and array item gets its own line, and empty objects and arrays stay as {} and []. Copy puts the text on your clipboard and Download .json saves Pixoate_output.json. Try sample loads a small example if you want to see the layout first.

  1. Paste your JSON into Input JSON, or upload a .json file.
  2. Leave Mode on Prettify.
  3. Pick 2, 4 or 8 spaces under Indent.
  4. Select Copy or Download .json.

Find and fix the error in invalid JSON

Only strict JSON passes, so a trailing comma, single quotes, an unquoted key, a comment, NaN or Python-style True and None all show an error instead of a result. The message comes from your browser's own parser, so its wording varies, and many browsers add the position, line and column. That position is where parsing gave up, which is usually just after the real mistake, so check the token before it. Smart quotes pasted from a document are a common hidden cause. The formatter does not guess a repair, so fix the spot and the formatted output appears once the whole document is valid.

Minify JSON into a single line

Choose Minify and every space, tab and line break between values is removed, while the text inside strings is kept. The result is the compact form to paste into a request body, an environment variable or a config field, and Download .json then saves Pixoate_output.min.json. If the JSON reaches you Base64-encoded, decode it first, and to turn a table into JSON instead, convert the rows.

Browse a large JSON response in Tree mode

Tree shows the parsed data as a collapsible tree. The first two levels open automatically, a collapsed node shows how many keys or items it holds, and array entries are labeled by their index. It is read-only, so use it to understand a big response, then switch to Prettify for text you can copy. Copy and Download in Tree mode give the indented text. To see what changed between two responses, compare them side by side after formatting both with the same Indent.

Know what formatting changes in your JSON

The tool parses your JSON and writes it out again, so some details are normalized. Numbers become standard JavaScript numbers: 1.50 becomes 1.5, 1e3 becomes 1000, and integers above 9,007,199,254,740,991 lose their last digits, so keep very large IDs as strings. Keys that look like whole numbers move to the front in ascending order. When a key repeats, only the last value is kept. Escapes such as \u00e9 are written as the character itself.

Before you use the formatted JSON

  • Keep very large numeric IDs as strings before you format them.
  • Check key order if another system depends on it.
  • Remove comments and trailing commas first, because the tool reports them and does not fix them.
  • Follow your organization's rules before pasting production secrets into any web page.

Comparing two responses works best when both use the same indent, after which you can highlight what changed line by line. If the data starts as a CSV or Markdown table, turn the rows into JSON objects or JSONL; for a pasted token rather than JSON, read the JWT header and claims; and fields locked inside a scanned invoice or form can be extracted from the image as JSON.

What you can do with JSON Prettify

Review the main capabilities before you begin.

  • Format messy JSON into clean, readable code
  • Validate JSON and catch syntax errors
  • Minify JSON into a single compact line
  • Choose 2, 4 or 8 space indentation
  • Copy or download the formatted result

Settings reference

Available controls for JSON Prettify.

Settings

ModePresets
Choose how your JSON is presented: Prettify formats it with readable indentation, Minify compresses it to a single line, and Tree shows an interactive collapsible view for exploring nested data.Options: PrettifyMinifyTree
IndentDropdown
Sets how many spaces each nesting level is indented in the prettified output (shown only in Prettify mode); pick 2 for compact code style or 4 or 8 for easier reading of deep structures.Options: 2 spaces4 spaces8 spaces
Free to use · No signup required · Without watermarkUploads are encrypted in transitRemoved under our retention policy

Frequently Asked Questions

How JSON Prettify helps you get it done

Real problems it solves every day — for businesses, creators, and everyday tasks. Find the use case that fits you and start.

For Developers

API Response Debugging

Paste a minified API response from your dev tools and instantly see the structure indented. Spot missing fields, validate the shape, and confirm null vs. undefined handling without firing up a JSON viewer extension.

For Developers

Config File Cleanup

Pull a tangled package.json, tsconfig.json or .eslintrc.json back into a readable shape after a merge conflict resolution. Format, sanity-check, and commit a clean version in one minute.

For Developers

Database Export Inspection

Inspect a JSON export from MongoDB, DynamoDB or Firestore before importing it. Validate that the structure matches your schema and that no records have unexpected null collisions.

For Developers

Webhook Payload Inspection

Capture an incoming webhook payload from Stripe, GitHub, Linear or Slack and pretty-print it to understand the shape — essential when building integrations or debugging missing event fields.

For Developers

Code Review Helpers

Paste reviewer-supplied JSON examples into PR descriptions in their full prettified form, or shrink them with Minify when space is tight in chat. Either way the file is valid and copy-paste safe.

Privacy & Security

Production Secret Handling

Because everything runs in your browser, you can paste production secret payloads to inspect them without any network round trip — exactly the workflow that DevOps teams need but cloud JSON tools can't provide safely.

For Developers

Explore Massive GraphQL & Nested API Responses

Switch to Tree mode to expand only the branches you care about in a huge nested payload, instead of scrolling a wall of prettified indentation to find one field.

Productivity

Prep Request Bodies for Postman & Insomnia

Paste a rough JSON body, prettify it to check the shape is right, then Minify before saving it into a Postman or Insomnia collection so it stores compactly.

Education

Teach JSON Structure to New Developers

Use Tree mode's collapsible nested view to walk bootcamp students or junior engineers through how objects and arrays nest, without them getting lost in raw indentation.

For Business

Tidy Log Exports Before Filing a Support Ticket

Paste a minified error log or JSON blob copied from your monitoring tool, prettify it into a readable format, and paste the clean version into a support ticket or Slack thread.

For Developers

Validate Config Files Before Committing

Paste a package.json, tsconfig.json or other JSON config file to catch a stray trailing comma, unmatched bracket or unquoted key with immediate validation feedback — before a malformed config breaks your build or CI pipeline.

Watch each transformation land

Every photo crosses the slash untouched and comes out the other side finished.