JSON Editor

Write JSON with live validation, then format or minify

  • 100% Free
  • Files stay private
  • Works in your browser
Try it now·JSON Editor
validated live
Empty
Indent

Edit freely. Validation, formatting and minifying all happen in your browser. Format and Minify are enabled only while the document is valid.

How it works

  1. Paste or type JSON

    Type or paste your JSON in the editor. A badge shows Valid JSON or Invalid as you edit, and tiles such as Keys and Depth appear once it is valid.

  2. Format or minify it

    Press Format to re-indent using the Indent menu (2 spaces, 4 spaces or Tab), or Minify to put it on one line. Both work only on valid JSON.

  3. Copy or download

    Press Copy to put the edited text on your clipboard, or Download to save it as a data.json file.

Edit JSON in a live-validated workspace, then format or minify it in place with your chosen indent, with the exact line and column flagged whenever something breaks.

What is JSON Editor?

JSON Editor is a free online workspace for writing and reshaping JSON. As you type, it validates continuously and shows a status badge (empty, valid, or invalid with the precise error location), so you always know the state of your document. When it's valid you can reformat it or strip it to a single minified line with one click, then copy or download the result. It matters because editing JSON by hand is where small syntax mistakes creep in.

Who Benefits from This Tool

  • Developers: tweak a config or fixture and confirm it's still valid before saving.
  • API integrators: hand-craft request bodies and format them cleanly for documentation.
  • DevOps engineers: adjust manifests and settings files with live safety checks.
  • Technical writers: produce tidy, consistently indented JSON examples for docs.
  • QA engineers: build and edit test payloads without fear of a stray comma.

Key Features

  • Live validation: a status badge tracks valid, invalid or empty as you type.
  • Format in place: pretty-print the current document with a 2-space, 4-space or tab indent.
  • Minify in place: collapse the document to a single compact line instantly.
  • Inline error markers: invalid JSON shows the message plus line, column and a caret in a preview.
  • Live stats: key count, type, depth and byte size update as the document changes.
  • Safe actions: Format and Minify are enabled only while the JSON is valid.
  • Copy and download: save your work as a .json file or copy it to the clipboard.

How to Use

  1. Paste, type or Try sample to load JSON into the editor.
  2. Watch the status badge. Green means valid, red shows the error's line and column.
  3. Once valid, click Format to pretty-print or Minify to compress, choosing your indent as needed.
  4. Review the live stats to confirm the structure.
  5. Copy the result or download it as a .json file.

Common Use Cases

  • Fixing a broken config file, using the live badge to confirm each edit stays valid.
  • Beautifying a minified blob so you can read and modify it.
  • Compressing a formatted document before pasting it into code or an environment variable.
  • Building a test payload from scratch with immediate feedback on syntax.
  • Standardising the indentation of JSON snippets for a shared style guide.

Tips and Best Practices

  • Format before minifying. It's easier to spot mistakes in pretty-printed form.
  • If Format and Minify are greyed out, your JSON is invalid; fix the flagged line first.
  • Use the caret in the error preview to land directly on the problem character.
  • Pick an indent that matches your repository's convention before copying out.
  • Keep a backup of the original if you're making large structural changes.

Limitations and Notes

All editing, validation, formatting and minifying happen entirely in your browser. Nothing is uploaded. This is a text editor with syntax awareness, not a schema-aware form editor, so it validates that your JSON is well-formed but not whether it matches a particular data model. Format and Minify only operate on a valid document; they cannot repair broken JSON, and they preserve your data exactly while changing only whitespace.

FAQs

No. Everything runs locally in your browser, so your content never leaves your device.

They only activate when the document is valid JSON. Fix the error shown by the status badge and they'll enable automatically.

No. Formatting and minifying only adjust whitespace and indentation; keys, values and order are preserved.

No. It checks that the JSON is syntactically valid, not that it conforms to a specific schema or set of required fields.

You can format with 2 spaces, 4 spaces or a tab, whichever matches your project's style.

The Viewer is read-only and focuses on an interactive tree; the Editor is a text workspace built for making changes with live validation and in-place formatting.

More Development Tools

Other tools in Development Tools.

All Development Tools