Check
Format and check JSON
Indent it, or find out where the parser stopped.
The check is the browser’s own JSON parser, not a re-implementation, so anything it accepts is JSON that every other parser accepts too. Formatting re-serialises the parsed value with two spaces of indentation.
When the input is invalid, the result is the parser’s own message, word for word. Some errors come with a position and some do not — browsers vary, and Chrome can name the offending token without a character offset — but the reason it stopped is always more use than a generic “invalid JSON”.
A round trip through the parser also removes what JSON does not have: comments, trailing commas, and duplicate keys where the last one wins. A file that relied on a duplicate key will keep only one value here — which is what any consumer of that file would have seen anyway.
Questions
Does it accept comments or trailing commas?
No. JSON allows neither and neither does this parser. That is why a file that loads inside a JavaScript file can still fail here: a JavaScript object literal is not JSON.
Will it repair my broken JSON?
No. It tells you why the parser stopped; the fix is yours. Guessing at a repair would be worse than the error.
Is the JSON uploaded?
No. The parse happens in the tab and nothing is stored.
Why did a duplicate key disappear?
JSON objects have unique keys. The parser keeps the last one, and that is what every consumer of the file sees.
More text and code
- Word counterWords, characters, sentences and reading time, counted as you type.
- Case converterTitle Case, sentence case, camelCase, snake_case and the rest, at once.
- Base64Encode text to base64 and decode it back, UTF-8 safe.
- URL encoderPercent-encode text, or read what a %-encoded string says.
- Hash generatorSHA-256, SHA-1 and SHA-512 of any text, from the browser’s own crypto.
- UUID generatorFive version-4 UUIDs from the browser’s random source, ready to copy.
- Timestamp converterEpoch seconds, milliseconds, ISO 8601, UTC and your own time zone.
- Colour converterHEX, RGB and HSL from one value, with WCAG contrast ratios.
- Slug generatorA clean URL slug from any title, accents and punctuation handled.
- CSV to JSONRows to objects, with quoted commas, semicolons and tabs handled.
- Text diffTwo texts, line by line: what was added and what was removed.