JSON Formatter & Validator

Format, repair, explore, and convert JSON — instantly in your browser. Sort keys, fix broken JSON, browse an interactive tree, export to CSV or YAML.

Input JSON
0 chars | 0 B | 0 lines
Output
100% Private. Your data never leaves your device. All processing happens in your browser — nothing is sent to any server.

Format or validate your JSON on the Formatter tab first,
then switch here to explore the interactive tree.

Path: $

Transform your parsed JSON into other formats. All conversions run client-side using the JSON from the Formatter tab.

Output
Select a conversion above to see the result here.

JSON → CSV

Requires a JSON array of objects at the root. Each object becomes a row; keys become column headers. Nested objects are stringified in their cell.

JSON → YAML

Converts any valid JSON to clean YAML format. Strings are auto-quoted only when necessary. Great for Kubernetes configs, CI/CD pipelines, and human-readable settings files.

Escape / Unescape

Escape wraps minified JSON as a string literal (useful for embedding JSON in other JSON or code strings). Unescape does the reverse — decodes an escaped string back to formatted JSON.

How to Use

1

Paste Your JSON

Paste or type raw JSON into the input area on the Formatter tab. It can be minified, poorly formatted, or even contain errors. Enable Auto-format on paste to skip clicking Format.

2

Format, Validate, or Repair

Click Format to beautify, Minify to compress, Validate to check syntax, or Repair to auto-fix trailing commas, comments, and single quotes. Use Ctrl+Enter to format instantly.

3

Explore the Tree

Switch to Tree Explorer to browse your JSON as an interactive tree. Click to expand/collapse nodes, search for keys or values, and hover to see the full JSONPath.

4

Convert & Export

Use the Convert tab to export to CSV (for arrays), YAML, or encode/decode escaped JSON strings. Copy to clipboard or download the file.

Frequently Asked Questions

Is my JSON data sent to a server?

No. All processing happens entirely in your browser using JavaScript's built-in JSON.parse() and JSON.stringify(). Your data never leaves your device, making this tool safe for sensitive API keys, config files, and private data.

What does the Repair feature fix?

Repair handles the most common reasons JSON fails to parse: trailing commas (e.g. {"a":1,}), JavaScript-style comments (// and /* */), and single-quoted strings (common when copying from Python dicts). It's ideal for fixing hand-edited configs or JavaScript object literals.

What does Sort Keys do?

Sort Keys recursively sorts all object keys alphabetically throughout the entire JSON structure. This makes it easy to compare two JSON objects visually, find keys quickly, and produce deterministic output.

Can I use tabs instead of spaces for indentation?

Yes. Use the Indentation dropdown to choose between 2 spaces, 4 spaces, or tab characters. The setting is remembered for your next visit.

Why doesn't JSON to CSV work for my data?

CSV export requires a JSON array of objects at the root level. If your root is a plain object ({}), you'll need to wrap it in an array first. Arrays of primitives (strings, numbers) are also supported and produce a single-column CSV. Nested objects within rows are preserved as JSON strings in their cell.

Why am I getting "Unexpected token" errors?

Common causes include trailing commas (not allowed in JSON), single quotes instead of double quotes, unquoted keys, or comments. Try clicking Repair — it automatically fixes all of these. The error message also shows the exact line and column to help you locate the issue manually.

Is there a file size limit?

There is no hard limit. Very large files (over ~50 MB) may slow down your browser since everything runs client-side. The Tree Explorer uses lazy rendering so even large nested structures open quickly — deep nodes only render when you expand them.