# JSON Formatter, Validator, Minifier & Tree Viewer Online

> Free online JSON formatter: beautify or minify, validate with the exact line and column of any error, browse a collapsible tree, sort keys and escape strings.

- URL: https://qilingtools.com/en/json
- Category: Developer Tools (https://qilingtools.com/en/dev)
- Tags: [Developer](https://qilingtools.com/en/tags/dev), [Data Formats](https://qilingtools.com/en/tags/data), [Code Formatting](https://qilingtools.com/en/tags/format)
- Last updated: 2026-10-29
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

Paste a one-line API response and get neatly indented, syntax-highlighted JSON instantly. Switch to the tree view to fold and unfold each level and copy the path of any field. The tool validates as you type and, when something is wrong, tells you the exact line and column and what is probably missing, with a one-click jump to the spot. It can also minify to a single line, sort keys recursively, escape and unescape strings, convert between \uXXXX escapes and real characters, and copy or download the result. Everything runs in your browser, so API payloads and config files never leave your machine.

## How to use

1. Paste JSON into the left box, or click "Open file" or drop a .json file onto it
2. The formatted result appears on the right instantly; choose "Minify" for a single line or "Tree view" to browse level by level
3. Adjust the indent, tick "Sort keys" or "Escape non-ASCII" if needed, then "Copy result" or "Download"

## Features

- Live pretty-print or minify with 2-space, 4-space or tab indentation
- Validation with exact line/column and one-click jump to the error
- Collapsible tree view with hover-to-copy field paths
- Recursive key sorting for easy diffing
- Escape / unescape strings to handle JSON nested inside strings
- Convert between \uXXXX escapes and real characters
- Syntax highlighting; files up to 20 MB
- Remembers your last input; processed locally, never uploaded

## FAQ

### The JSON is reported as invalid but I cannot see why

The status bar shows the line and column of the error, the likely cause (a trailing comma, an unquoted key, a missing bracket) and a snippet around the spot. Click "Go to error" to select the offending character in the input. The most common mistakes are a comma after the last item, single quotes, unquoted keys and comments; none of these are allowed in standard JSON.

### The response contains JSON escaped inside a string. How do I read it?

Click "Unescape" first. The tool unwraps the outer JSON string (turning \" into " and \n into a line break) to reveal the inner JSON, which you can then format normally. The reverse, "Escape", prepares a JSON snippet for embedding in a string field.

### Non-ASCII text shows up as \u4e2d\u6587

Just format it: by default the tool decodes \uXXXX escapes into the real characters. If you need the opposite, for example a config that only accepts ASCII, tick "Escape non-ASCII".

### How large a file can it handle?

There is no hard limit on pasted text and files up to 20 MB can be opened. JSON of a few megabytes formats normally; for very large documents syntax highlighting is switched off to stay responsive, and the tree view renders long arrays in batches.

### Do very long numbers lose precision?

Yes, this is a JavaScript limitation: integers above 2^53 (such as 19-digit snowflake IDs) lose precision when parsed. If your JSON contains such IDs and you need the exact values, use the tool only to inspect the structure, or have the backend return those IDs as strings.

### Is my data uploaded anywhere?

No. Parsing, formatting and the tree view all run inside your browser with no network requests. For convenience the input is kept in your browser's local storage so it is still there next time; click "Clear" to remove it.

### Does it support JSON5, JSONC (comments) or single quotes?

Only standard JSON (RFC 8259) is validated at the moment. Comments, single quotes and trailing commas are reported as errors with their position, so that the result can be read by any parser.

## Related tools

- [Base64 Encode/Decode](https://qilingtools.com/en/base64): Free online Base64 encoder and decoder: UTF-8 safe, optional URL-safe variant, convert text to Base64 and back in real time. Processed locally, never uploaded.
- [URL Encode/Decode](https://qilingtools.com/en/url-encode): Free online URL encoder and decoder with encodeURIComponent and encodeURI modes. Escapes Chinese, spaces and special characters. Real-time and local, no upload.
- [JWT Decoder](https://qilingtools.com/en/jwt): Free online JWT decoder: decode the header and payload of a JSON Web Token, show expiry and issued-at times, all locally without uploading the token.
- [Timestamp Converter](https://qilingtools.com/en/timestamp): Free online Unix timestamp converter: convert timestamps and dates, auto-detect seconds or milliseconds, and show local, UTC, ISO 8601 and relative time.
- [Hash / Checksum](https://qilingtools.com/en/hash): Free online hash calculator: SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file through the browser crypto API. Files never leave your device.
- [UUID Generator](https://qilingtools.com/en/uuid): Free online UUID generator: create RFC 4122 UUID v4 in bulk with a cryptographic RNG. Options for uppercase, no hyphens and braces, with one-click copy.
- [Base Converter](https://qilingtools.com/en/base-convert): Free online number base converter: convert between binary, octal, decimal, hexadecimal and any base 2–36. Uses BigInt for huge integers, computed locally.
- [Regex Tester](https://qilingtools.com/en/regex): Free online regular expression tester: match and highlight as you type, list capture groups and support the g/i/m/s/u flags. Runs locally, nothing uploaded.
