JSON Formatter & Validator
Format messy JSON with clean indentation, minify it back, or find the exact position of a syntax error. Runs locally in your browser.
Format, minify, validate
The formatter takes the single-line JSON that APIs and log files produce and lays it out with readable indentation. Minify does the reverse when you need the smallest possible payload. Sorting keys alphabetically makes two responses diffable, which is the fastest way to see what changed between two API calls.
Reading the error message
JavaScript's JSON parser reports the character position where parsing failed, which is usually a few characters after the real mistake. When it complains about an unexpected token, look backwards for these first:
- Trailing commas -
{"a":1,}is invalid JSON even though modern JavaScript allows it in code. - Single quotes - JSON requires double quotes around both keys and string values.
- Unquoted keys - valid in a JavaScript object literal, invalid in JSON.
- Smart quotes - copying from a document editor often replaces straight quotes with curly ones.
- NaN, Infinity and undefined - none of these exist in JSON.
Privacy
API responses frequently contain tokens and personal data. Nothing here is uploaded or logged: the parsing happens in the page, so the tool is safe on production payloads.
Frequently asked questions
Why does my JSON fail after copying from a document?
Word processors replace straight quotes with curly ones. Search for those characters and replace them with plain double quotes.
Can it handle large payloads?
Anything your browser can hold in a textarea. Very large files may make the page slow rather than fail.
Does it fix invalid JSON automatically?
No. It reports the parser error instead of silently guessing, because guessed repairs hide real data problems.
Related tools
Word Counter
Count words, characters, sentences and paragraphs as you type, with an estimated reading time. Runs entirely in your browser.
Character Counter
Count characters with and without spaces, letters, digits and punctuation, plus a letter frequency table for any text.
Case Converter
Convert text between eight letter cases instantly: uppercase, lowercase, title case, sentence case, camelCase, PascalCase, snake_case and kebab-case.
Base64 Encoder & Decoder
Encode plain text to Base64 or decode Base64 back to text, including URL-safe variants. Runs entirely in your browser.