JSON Formatter and Validator Online
Format, minify, validate, and sort JSON with precise errors and lossless large-integer handling.
Safely work with real JSON data
Format, minify, and strictly validate JSON with precise errors shown directly in the editor. Choose two spaces, four spaces, or tabs; recursively sort object keys; then copy the result or download it as a JSON file. Processing stays entirely in your browser, making the tool suitable for API responses, logs, configuration files, and sensitive payloads.
A basic JSON.parse and JSON.stringify workflow can alter numbers outside JavaScript's safe integer range. This tool works from the syntax tree and original source tokens, so formatting, minification, and sorting never convert 64-bit integers into regular JavaScript numbers.
How to use
- Paste JSON or open a local
.json file up to 10 MB; - Choose Format, Minify, Validate, or Sort keys;
- For invalid JSON, click the line-and-column message to jump to the error;
- Copy the result or download it as
formatted.json.
FAQ
- Will formatting change large integers?
- No. The tool works with the JSON syntax tree and original tokens instead of converting values to JavaScript numbers first, so 64-bit IDs, scientific notation, and -0 keep their original numeric spelling.
- Why is key sorting disabled when duplicate keys exist?
- Programs disagree on whether the first or last duplicate key wins. Reordering duplicate keys can therefore change the effective value. Formatting and minification preserve them, while sorting is safely blocked.
- Does it support JSONC, comments, or trailing commas?
- The validator intentionally follows strict JSON. Comments, trailing commas, single quotes, and unquoted property names are rejected so non-standard input is never presented as portable JSON.
- Is my JSON uploaded to a server?
- No. Validation, formatting, minification, and sorting run locally in your browser. Your JSON never leaves your device; the site only uses Cloudflare for anonymous usage and performance metrics.