JSON Basics: How to Format, Validate and Convert JSON
Everything beginners need to work with JSON confidently
JSON (JavaScript Object Notation) is the language APIs speak. Whether you are connecting a payment gateway, exporting data from a CRM or debugging a web app, sooner or later you will stare at a wall of curly braces. This guide explains how JSON works and how to handle it without writing a single line of code.
What JSON looks like
JSON stores data as key–value pairs. Keys are always strings in double quotes; values can be strings, numbers, booleans (true/false), null, arrays in square brackets, or nested objects in curly braces. A simple example: {"name": "Sara", "age": 29, "skills": ["design", "seo"]}. That readability is exactly why JSON replaced XML as the default data format of the web.
Why your JSON breaks (and how to fix it)
Most JSON errors come down to a handful of mistakes: a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, or a missing closing brace. The error messages from servers are often cryptic, so the fastest fix is to paste your data into our free JSON Validator — it pinpoints the exact line and character where the syntax fails.
Minified JSON from an API response is almost impossible to read as one long line. Run it through the JSON Formatter to indent it properly, or explore it interactively with the JSON Viewer, which collapses and expands nested levels like a file tree.
Converting JSON to other formats
Spreadsheet users usually want CSV: the JSON to CSV converter flattens arrays of objects into rows you can open in Excel. Working with a legacy system that expects XML? Use JSON to XML, or go the other way with XML to JSON. There are also converters for CSV to JSON and JSON to Text when you need plain output.
Minify before you ship
Pretty-printed JSON is great for humans but wasteful for machines: all that whitespace adds up. Before embedding JSON in a production config or response, squeeze it with JSON Minify. On large files the size reduction can reach 20–30%, which matters on mobile networks.
Practical tips that save hours
Always validate after hand-editing — one stray comma can take down a deployment. Keep numbers as numbers: wrapping them in quotes turns them into strings and breaks calculations downstream. Use consistent key naming (camelCase or snake_case, not both). And when an API returns something unexpected, format the response first; nine times out of ten the problem becomes obvious once the structure is readable.
All of these utilities are free, run entirely in your browser, and never store your data — find the full set in our Development Tools section.