JSON Formatter & Validator
FormattingEverything runs locally in your browser — nothing is uploaded
Expand minified JSON into a readable structure, or strip it back down to a single line. When the syntax is broken you get the exact line and column plus a caret under the offending character, so you no longer have to count brackets by hand. Recursive key sorting makes two exports of the same data diffable.
Features
- Format with 2-space, 4-space or tab indentation
- Minify to remove all whitespace for request bodies or storage
- Validate with the error pinpointed to an exact line and column
- Sort keys recursively, leaving array order untouched
- Large documents are handled without freezing the page
How to use
- Paste your JSON into the input box
- Pick the mode, indentation and other options
- Press Ctrl/⌘ + Enter, or click Run
- Click Copy to take the result
FAQ
- Is my JSON uploaded anywhere?
- No. Parsing and formatting happen entirely in your browser memory. The page makes no network requests and keeps working offline.
- Why do I get "unexpected character after number"?
- JSON has a stricter number grammar than JavaScript: it rejects +1, .5, 01, 1. and Infinity / NaN. Convert those to valid JSON numbers first.
- Does sorting keys affect arrays?
- No. Array order carries meaning and sorting would destroy it, so only object keys are sorted. Arrays are always left exactly as they were.
- How large a document can it handle?
- Several megabytes is fine. Past the input limit you get a clear message instead of an unresponsive page.
Related tools
JSON to Code
FormattingTurn JSON into TypeScript interfaces, Go structs, Java classes or Rust structs, with missing keys marked optional. Runs locally in your browser.
JavaScript Beautifier
FormattingBeautify minified JavaScript by re-indenting on braces and semicolons, with strings and comments kept verbatim. Indentation only, nothing uploaded.
JWT Decoder
Encoding & CryptoSplit a JWT into header, payload and signature, and read iat, nbf and exp as dates. The signature is not verified — decoding only, all in your browser.
Text Diff
TextCompare two blocks of text online and highlight added, removed and unchanged lines, so only the lines that changed are marked. Runs in your browser.
SQL Formatter
FormattingFormat SQL online: one clause per line, consistent keyword case, subqueries indented deeper. Minify strips comments and extra whitespace, all locally.
XML Formatter
FormattingFormat XML online by tag level, with comments, CDATA and DOCTYPE on their own lines and attribute values left untouched. Runs locally in your browser.