SmartWebTools / SMART LITTLE TOOLS FOR EVERYDAY TASKS
SmartWebTools / Tool

JSON Formatter & Validator

Paste raw or minified JSON to check it's valid and format it with readable indentation.

SN JF-07
Advertisement

What "valid JSON" actually requires

JSON is stricter than JavaScript object literals: keys must be double-quoted strings, trailing commas aren't allowed, and values are limited to strings, numbers, booleans, null, objects and arrays — no comments, functions, or undefined. This tool uses the browser's own JSON parser, so any error message it shows reflects exactly what a real application would reject.

Common uses

  • Debugging an API response that's failing to parse
  • Turning a minified config file into something readable before editing
  • Compressing a formatted JSON file back down before sending it over the wire

Frequently asked questions

Why does my JSON say it's invalid when it looks fine?

Common causes are trailing commas after the last item in an object or array, single quotes instead of double quotes around keys and strings, or unquoted keys — all valid in JavaScript object literals but not in strict JSON. The error message shows exactly where the parser stopped.

What's the difference between formatting and minifying JSON?

Formatting adds indentation and line breaks to make JSON readable for humans; minifying strips all unnecessary whitespace to make the file as small as possible for transmission. Both represent the same data.

Can JSON have comments?

No — the JSON specification doesn't support comments, unlike JavaScript or JSON5. If your input has // or /* */ comments, this tool (and any standard JSON parser) will reject it as invalid.

Is my JSON data sent anywhere when I use this tool?

No — parsing and formatting happen entirely in your browser using the built-in JSON parser. Nothing is uploaded to a server.

Advertisement