JSON and data tools
Format, validate and diff JSON, convert it to XML, YAML, CSV, TOML and .env, check it against a schema, and generate types for eleven languages.
- JSON Formatter & Validator: Validate, pretty-print or minify JSON.
- JSON Diff: Compare two JSON documents, ignoring key order and formatting.
- JSONPath Tester: Query JSON with a JSONPath expression.
- XML to JSON Converter: Convert between XML and JSON, from text or a file.
- YAML to JSON Converter: Convert between YAML and JSON, from text or a file.
- CSV to JSON Converter: Convert between CSV and JSON, from text or a file.
- JSON to TypeScript: Infer TypeScript interfaces from a JSON sample.
- JSON to Python Dataclass: Infer Python dataclasses from a JSON sample.
- JSON to Pydantic Model: Infer Pydantic models from a JSON sample.
- JSON to Go Struct: Infer Go structs with json tags from a JSON sample.
- JSON to Rust Struct: Infer Rust structs with serde derives from a JSON sample.
- JSON to Kotlin: Infer Kotlin data classes from a JSON sample.
- JSON to C# Class: Infer C# classes from a JSON sample.
- JSON to Zod Schema: Infer Zod schemas and their TypeScript types from a JSON sample.
- JSON to Java Class: Infer Java records, ready for Jackson, from a JSON sample.
- JSON to Swift Struct: Infer Swift Codable structs from a JSON sample.
- JSON to PHP Class: Infer PHP 8 classes with typed, promoted properties from a JSON sample.
- TOML to JSON Converter: Convert between TOML and JSON, from text or a file.
- .env to JSON Converter: Convert between .env files and JSON, from text or a file.
- JSON Schema Generator: Infer a draft 2020-12 JSON Schema from a JSON sample.
- JSON Schema Validator: Check a JSON document against a JSON Schema and list every error.
Which tool to use
- Check or tidy a document: the JSON Formatter & Validator validates, pretty-prints or minifies.
- See what changed: JSON Diff compares two documents while ignoring key order and formatting.
- Pull values out of a large document: the JSONPath Tester runs a JSONPath expression and shows the matches.
- Move between formats: the XML, YAML, CSV, TOML and .env converters work in both directions, from pasted text or a file.
- Describe or enforce a shape: the JSON Schema Generator infers a schema from a sample, and the JSON Schema Validator checks a document against one and lists every error.
- Turn a sample response into types: JSON to TypeScript interfaces, Python dataclasses, Pydantic models, Go structs, Rust structs, Kotlin data classes, C# classes, Java records, Swift structs, PHP classes or Zod schemas.
What to expect from the type generators
The generators infer types from a single sample, so they can only describe what the sample shows. A field that is null, missing or an empty array in the sample cannot be typed precisely. Paste the most complete response you have, then review optional and nullable fields by hand.
Privacy
API responses tend to carry tokens, email addresses and customer records. Every tool in this group parses and converts in the browser tab, so the document is never uploaded.
Frequently asked questions
- How do I validate JSON online without uploading it?
- Use a validator that runs in the browser. The JSON Formatter & Validator on XUtil parses the text in the page itself, so the document never leaves your machine.
- What is the difference between JSON and YAML?
- Both describe the same kinds of data. JSON is strict, uses braces and quotes, and is what most APIs exchange. YAML uses indentation, allows comments and is common in configuration files. Converting YAML to JSON drops the comments.
- Can I generate TypeScript types from a JSON response?
- Yes. Paste a sample response into the JSON to TypeScript tool and it infers interfaces from it. Check optional and nullable fields afterwards, because one sample cannot show every shape the API returns.
- Why does converting XML to JSON and back not give the same file?
- XML has attributes, namespaces, mixed text and element order, none of which map directly onto JSON objects. A converter has to pick a convention for each, so a round trip keeps the data but not always the exact layout.