dev-tools tool

JSON Formatter, Validator & Minifier

Format, validate, and minify JSON in your browser — paste your JSON or drop a .json file to load it instantly. Errors are flagged by line number in real time, so you find mistakes without counting brackets. Sort keys, remove nulls, escape strings, convert to YAML or CSV, and download the result. Free, no sign-up, nothing uploaded.

JSON Formatter, Validator & Minifier

Paste JSON or drop a .json file on the left. Format, transform, and convert — output appears on the right, ready to copy or download. Everything runs in your browser. Your JSON is never sent to any server.

Input· drop .json here
Loading editor…
Output
Loading editor…

About This Tool

JSON Formatter, Validator & Minifier is a free online tool for anyone who works with JSON — developers, data analysts, testers, and anyone building or debugging APIs. Paste raw JSON or drop a .json file into the editor, and get a cleanly formatted, validated document in one click. Everything runs in your browser — your JSON is never sent to any server.

Real-time validation checks your JSON as you type, instantly flagging syntax errors before you even click Format. When a problem is found, a red error banner shows you the human-readable message and the exact line number where the error is. Click Go to line to jump the editor cursor directly to the problem — no more manually counting opening brackets or scrolling through hundreds of lines.

Format and Minify transform your JSON with one click. Format prettifies the output with configurable indentation — 2 spaces, 4 spaces, or Tab. Two transform toggles apply on top of any format or minify operation: **Sort Keys** recursively alphabetises every object key at every nesting depth, which is essential for normalising API responses before running a diff. Remove Nulls strips every null value from the tree, cleaning up sparse payloads before they reach a client or database.

Escape and Unescape solve a common developer pain point — embedding JSON inside another string. Escape wraps your content in a quoted string with all internal double quotes backslash-escaped: the format required for .env files, YAML string fields, SQL INSERT statements, and shell variables. Unescape reverses the operation, unwrapping an escaped JSON string literal back into its original structured form.

JSON → YAML converts your data to clean, idiomatic YAML — ready for Kubernetes manifests, GitHub Actions workflows, Docker Compose files, and Helm values files. **JSON → CSV** detects when your JSON is an array of objects and exports it as a comma-separated table that opens directly in Excel, Google Sheets, or any data analysis tool. Both conversions happen entirely in your browser with no waiting.

File workflow: drag a .json file from your file explorer and drop it directly onto the input area to load it — no file picker needed. After formatting or converting, click Save to download the result as a .json, .yaml, or .csv file with the correct extension set automatically. Use Copy to send the output to your clipboard in one click. The Reset button clears both panels so you can start a new session, and Clear in the output panel wipes just the output if you want to try a different transform on the same input.

How To Use

  1. 1. Paste JSON into the Input editor, or drag and drop a .json file directly onto the editor area to load it instantly.
  2. 2. Real-time validation runs automatically — a green ✓ label confirms valid JSON; a red ✗ appears with the error message and line number.
  3. 3. If a validation error is shown, click Go to line to jump the editor cursor to the exact problematic line.
  4. 4. Use Ctrl+F (Cmd+F on Mac) to open the built-in search panel inside either editor. Use Ctrl+H to open find & replace in the input editor.
  5. 5. Click the fold arrows in the editor gutter to collapse and expand any JSON object or array — useful for navigating large documents.
  6. 6. Click Format to prettify the JSON in the output panel. Use the indent selector to choose 2 spaces, 4 spaces, or Tab.
  7. 7. Enable Sort Keys or Remove Nulls toggles before formatting to apply those transforms to the output.
  8. 8. Click Escape to wrap the input as an escaped JSON string, or Unescape to unwrap an escaped string literal back to its original form.
  9. 9. Click → YAML to convert to YAML format, or → CSV to export an array-of-objects as a spreadsheet-compatible table.
  10. 10. Click Copy to copy the output to clipboard, Save to download the output file, or Reset to clear both panels for a new session.

Features That Plain Text Formatters Can't Match

Most online JSON formatters use a plain textarea with no editor intelligence. This tool uses a full code editor in the browser, which unlocks a different class of features — and everything still runs locally, with no data sent to any server.

  • Line NumbersEvery line is numbered, matching your terminal and IDE.
    When a colleague says 'error on line 247', you can navigate there instantly. Essential for debugging large API responses or deeply nested configuration files.
  • JSON FoldingCollapse any object or array with one click.
    Click the ▶ arrow next to any { or [ to collapse the entire node. Unfold only the section you need. Invaluable for JSON documents with hundreds of nested properties.
  • Find & ReplaceCtrl+F to search, Ctrl+H to replace across the entire document.
    Change a key name or value across a large JSON file in seconds — supports regex for advanced users.
  • Go to ErrorJump directly to the syntax error location.
    The status bar shows the exact line number of the problem. Click 'Go to line' to move the cursor and scroll the editor to that position in one action.
  • Syntax HighlightingKeys, strings, numbers, booleans, and nulls each have distinct colours.
    Bracket pair colourisation makes deeply nested structures readable at a glance — no manual bracket tracking required.
  • MinimapA zoomed-out document overview on the right edge of the editor.
    Jump to any section of a large JSON file by clicking on the minimap, without endless scrolling.

Frequently Asked Questions

Is my JSON sent to any server? Is it private?

No — everything runs entirely in your browser. Your JSON content is never transmitted to any server, API, or third-party service. Formatting, validation, minification, sorting, conversion to YAML or CSV — all of it happens locally on your device using JavaScript. The tool itself loads from a public CDN the first time you visit and is then cached, but your actual data never leaves your browser.

How is this different from a basic online JSON formatter?

Most online JSON formatters use a plain textarea — no line numbers, no error location, no folding. This tool uses a full code editor in the browser that adds line numbers, syntax highlighting, JSON folding, find & replace, bracket pair colourisation, and a minimap. On top of that it includes Sort Keys, Remove Nulls, Escape/Unescape, YAML conversion, CSV export, file drop, and output download — features that cover real workflow problems, not just pretty-printing.

How do I navigate to a JSON error?

When your JSON has a syntax error, a red banner below the editors shows the error message and the line number. Click Go to line to move the cursor to the exact line and scroll it into view automatically. The editor also draws red underlines at the problematic character — hover over any red underline to see the error tooltip directly in the editor.

How do I collapse a large JSON object or array?

Click the small ▶ triangle in the gutter (left margin) next to any { or [ character. The entire node collapses to a single summary line. Click it again to expand. Right-click the editor and choose 'Fold All' or 'Unfold All' from the context menu to collapse or expand every node at once — useful for getting a high-level overview of a large document.

Can I open a .json file directly?

Yes. Drag a .json file from your file explorer and drop it onto the input editor area. The file contents load into the editor immediately — no file picker dialog needed, and the file is never uploaded anywhere. There is no enforced file size limit beyond your device's available memory.

How do I save the formatted output?

Click the Save button in the output panel header after any format, convert, or transform operation. The file downloads with the correct extension automatically: .json for JSON output, .yaml for YAML conversion, and .csv for CSV export. Use Copy if you just need the output on your clipboard.

When should I use Sort Keys?

Sort Keys recursively alphabetises every object key in the JSON tree at every nesting level. Array order is always preserved — only object keys are sorted. Use it before comparing two API responses in a diff tool — sorted JSON produces clean, readable diffs with no false positives from key reordering. It is also useful for normalising configuration files before committing to a repository so that unrelated key reorders don't pollute your git history.

What does Remove Nulls do?

Remove Nulls traverses the entire JSON tree and removes every key-value pair where the value is null. It works at every nesting depth recursively. Use it to clean up API responses before sending them to clients that reject null, or to strip unpopulated optional fields before storing a payload in a database.

How does Escape and Unescape work?

Escape takes whatever is in the input editor and wraps it as a JSON string literal — all internal double quotes become \" and newlines become \n. For example, {"key":"value"} becomes "{\"key\":\"value\"}". This escaped format is required for .env file values, YAML string fields, SQL INSERT statements, and embedding JSON in shell variables. To use Unescape, paste an escaped JSON string literal (with the outer quotes included) into the input and click Unescape — it outputs the unwrapped content.

What are the limitations of JSON → CSV conversion?

CSV conversion requires the JSON to be an array of objects — the format returned by most REST list endpoints and database query results. Column headers are derived from the keys of the first object in the array. Nested objects and arrays inside values are serialised as JSON strings in the CSV cell rather than flattened into additional columns. If your JSON is a plain object, a primitive, or an array of non-objects, the → CSV button is disabled.

Is there a file size limit?

No enforced limit. The editor handles large files well — documents of several megabytes load and format without issue. For very large files (50 MB+), YAML conversion involves an additional traversal step and may take a few seconds. The practical limit is your device's available memory.

Does the tool work offline?

Yes, after the first visit. The editor and all libraries load from a public CDN the first time, which the browser caches automatically. On subsequent visits — including offline — everything loads from cache and runs entirely on your device. No internet connection is needed to format, validate, minify, or convert JSON. Your data never leaves your browser, online or offline. If you have Toolist installed as a PWA, it works fully offline from the first launch.