JSON Tools
Format / Validate / Convert · 14 tools
JSON work is mostly four jobs: making it readable, making it valid, comparing two versions, and converting it into whatever the next system wants. The formatter handles the first two — it parses, reports the syntax error with a position, and re-emits the document with consistent indentation. Minify does the reverse for transport.
The converters cover the awkward edges of real projects: XML from legacy services, CSV for spreadsheets, YAML for configuration, cookie headers and query strings from browser devtools, and type definitions when you need the API response to be checked at compile time.
Which one do I need?
- A parse error you cannot locate: use the formatter first. It validates before formatting, so the error message tells you where the document actually breaks.
- Two config files that should be identical: JSON Diff compares parsed structure, so key order and whitespace do not produce false differences.
- Turning an API response into types: the code generator infers a shape from a sample — but read its output. Empty arrays carry no type information, and it cannot know whether a number is an int32 or an int64.
- Spreadsheet in, JSON out (or the reverse): the CSV tools follow RFC 4180 quoting. Nested objects have no CSV representation, so they will be flattened into something lossy.
- Reading a K8s or CI config: the YAML converter is hand-written for common structures. Anchors, aliases and multi-document streams are not supported, and it says so instead of guessing.
All tools in this category
Guides in this category
- JSON Validation: The Seven Most Common Syntax Errors and Their Real MessagesBeautify or minify JSON; validation errors show the exact position
- JSON Escaping: Why Your JSON Contains All Those BackslashesConvert text to an escaped form safe to embed in code strings, or revert it
- JSON Diff: Why a Text Diff of JSON Floods the Screen With NoiseCompare two JSON snippets; list added, removed and changed key paths
- JSON Key Sorting: Why Sort, and What Sorting BreaksRecursively sort all object key names in alphabetical order
- JSON to String: How to Count the Layers, and Why Data Turns Into a StringConvert between doubly-escaped strings and JSON
- JSON to XML: How Structures Map, and What Information Is LostConvert a JSON object into structurally equivalent XML
- XML to JSON: How Attributes, Text Nodes and Repeated Elements Are HandledConvert XML to JSON with the browser built-in parser
- JSON to CSV: How Headers Are Decided, How Fields Are Escaped, What Happens to Nested ObjectsExport an array of objects to CSV, with a selectable delimiter
- CSV to JSON: Header Row, Type Conversion and Common Format BreakageParse CSV into an array of objects, with optional header row
- JSON and YAML conversion: type traps, lost comments, and a security caveatConvert JSON to YAML and YAML to JSON; a hand-written parser covers common structures
- Generating type definitions from JSON: what it saves, and where you must edit by handGenerate TS / Go / Java / C# / PHP type definitions from a sample JSON
- Query string and JSON conversion: duplicate keys and nested structuresConvert between a URL query string and a JSON object
- Cookie parsing: the request header carries only key-value pairs, not the attributesParse a Cookie string into JSON, or join it back
- JSON and Properties conversion: flattening, arrays, and encoding conventionsConvert between JSON and Java Properties style key-value files
FAQ
Why does JSON not allow comments or trailing commas?
The specification defines exactly one grammar, and both are outside it. Comments were deliberately excluded so any conforming parser can consume any JSON document. JSON5 and JSONC extend the grammar for configuration files, but a strict parser will reject their output.
Why did my large integer come back wrong?
JavaScript numbers are IEEE-754 doubles, so integers above 2^53 - 1 cannot all be represented. Snowflake IDs, Discord IDs and nanosecond timestamps silently lose their last digits. Keep such values as strings in the JSON, or parse with a big-number-aware library.
Why does JSON to CSV show [object Object]?
CSV has rows and columns, with no way to express nesting. When a value is itself an object or array, the converter falls back to its default string form. Flatten the structure first, or serialize the nested value into its own column as a JSON string.