Paste messy JSON — validate it, pretty-print it, or minify it
Every page here solves one real JSON task: the exact steps, a live tool you can paste into, and the mistakes that cause the errors. Everything runs in your browser — nothing is uploaded.
JSON how-tos
- JSON to Protobuf (.proto) — Paste a JSON object and generate a proto3 message definition with inferred scalar types, numbered fields, and nested messages. Runs entirely in your browser.
- JSON to Pydantic Model — Paste a JSON object and generate matching Pydantic v2 BaseModel classes with inferred types, nested models, and Field aliases for non-identifier keys. Runs entirely in your browser.
- JSON to Zod Schema — Paste a JSON object and generate matching Zod schemas with inferred types, nested object schemas, and named exports. Runs entirely in your browser.
- JSON to C++ Struct — Paste a JSON object and generate matching C++ structs with inferred types, std::vector for arrays, and a struct for each nested object — ready for nlohmann/json. Runs entirely in your browser.
- JSON to Ruby Class — Paste a JSON object and generate matching Ruby classes with attr_accessor for every field, plus a separate class for each nested object. Runs entirely in your browser.
- JSON to Scala Case Class — Paste a JSON object and generate matching Scala case classes with inferred types, List[T] for arrays, and a nested case class for each object. Runs entirely in your browser.
- JSON to JSON Schema — Paste a JSON sample and generate a matching draft-07 JSON Schema with inferred types, required fields and additionalProperties. Runs entirely in your browser.
- JSON to Dart Class — Convert JSON to a null-safe Dart class with fromJson and toJson — no build_runner, no json_serializable. Runs in your browser, generates nested classes for Flutter models.
- Convert JSON to SQL INSERT — Paste a JSON object or array of objects and generate SQL INSERT statements in your browser. Strings are quoted and escaped, nested values become JSON strings. No upload.
- Convert JSON to XML — Paste a JSON object or array and convert it to clean, indented XML in your browser. Arrays become repeated elements, nested objects become nested tags. No upload.
- Convert XML to JSON — Paste XML and convert it to JSON in your browser. Attributes become @-prefixed keys, repeated elements become arrays, text is coerced to numbers and booleans. No upload.
- JSON to Kotlin Data Class — Paste a JSON object and generate matching Kotlin data classes with inferred types, nested classes, and Gson @SerializedName for non-identifier keys. Runs entirely in your browser.
- JSON to PHP Class — Paste a JSON object and generate matching PHP classes with typed properties (PHP 7.4+), inferred types, and nested classes. Runs entirely in your browser.
- JSON to Swift Codable Struct — Paste a JSON object and generate matching Swift Codable structs with inferred types, nested structs, and CodingKeys for non-identifier keys. Runs entirely in your browser.
- JSON to C# Class — Paste a JSON object and generate matching C# classes with auto-properties, inferred types, and nested classes. Runs entirely in your browser.
- JSON to Java Class — Paste a JSON object and generate matching Java record classes with inferred field types and nested records. Runs entirely in your browser.
- JSON to Rust Struct — Paste a JSON object and generate matching Rust structs with serde derives, inferred types, and nested structs. Runs entirely in your browser.
- Fix "Converting circular structure to JSON" — JSON.stringify hit an object that references itself. Here is why JSON cannot represent it and how to break the cycle.
- Fix "Unexpected token < in JSON at position 0" — This error means your code got HTML (usually a 404 or error page), not JSON. Here is how to confirm the real cause and fix it.
- Fix "Unexpected token u in JSON at position 0" — This error means you called JSON.parse(undefined). Here is why the token is "u" and the one-line fix.
- JSON to Go Struct — Paste a JSON object and generate a matching Go struct with json tags, nested structs, and inferred field types. Runs in your browser.
- JSON to Python Dataclass — Paste a JSON object and generate matching Python @dataclass definitions with type hints and nested classes. Runs in your browser.
- Fix "Expecting property name enclosed in double quotes" — This JSON error means an object key isn't a double-quoted string — single quotes, an unquoted key, or a trailing comma before }. The exact fixes.
- Fix Python "Expecting value: line 1 column 1 (char 0)" — json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) means json.loads() got an empty string or non-JSON (often HTML). How to fix it in Python.
- Fix Python JSON "Extra data: line 1 column N (char N)" — json.decoder.JSONDecodeError: Extra data means there is more than one JSON value in the string — concatenated objects or JSON Lines. How to parse it correctly.
- Fix "Unexpected end of JSON input" — SyntaxError: Unexpected end of JSON input means the JSON is empty, truncated, or has an unclosed bracket. The exact causes and how to fix each.
- Fix "Unexpected non-whitespace character after JSON data" — This newer V8/Node error means there is extra content after a complete JSON value — concatenated JSON or NDJSON. How to fix it in JavaScript.
- Fix "Unexpected token < in JSON at position 0" — Why JSON.parse throws "Unexpected token '<'" — your code parsed an HTML page instead of JSON — plus every other unexpected-token cause and its fix.
- Decode Base64 to JSON — Decode a base64 (or base64url) string back into JSON and pretty-print it. Useful for JWT payloads, config blobs, and API tokens that carry encoded JSON.
- Convert TSV to JSON — Turn tab-separated values (TSV) — the format you get from spreadsheets and database dumps — into a clean JSON array of objects. Handles quoting and type coercion.
- Convert JSON to an HTML Table — Convert a JSON array of objects into a clean, semantic HTML table with thead and tbody. Values are HTML-escaped so the markup is safe to drop into a page.
- Convert JSON to a Markdown Table — Convert a JSON array of objects into a GitHub-flavoured Markdown table you can paste into a README, issue, or docs page. Keys become the header row.
- Convert JSON to a URL Query String — Turn a flat JSON object into a URL-encoded query string. Keys and values are percent-encoded; arrays expand into repeated keys.
- Convert a URL Query String to JSON — Parse a URL query string (the part after the ?) into a JSON object. Handles URL-encoding, plus-as-space, and repeated keys as arrays.
- Compare Two JSON Objects — Diff two JSON documents by normalising both first: sort keys and pretty-print so a line-by-line comparison shows real changes, not formatting noise.
- Convert CSV to JSON — Turn a CSV file — with a header row — into a JSON array of objects. Learn how the header becomes keys, how to handle commas inside quotes, and how types are decided.
- How to Convert JSON to CSV — A clear walkthrough of turning a JSON array of objects into CSV: how columns are chosen, how nested values and booleans are handled, and the pitfalls that break the import.
- Convert JSON to YAML — Turn a JSON object or array into clean YAML by hand or with a converter. Learn the exact mapping of objects, arrays, strings, and multi-line values so the result parses.
- Decode a JWT — A JWT is three base64url parts separated by dots. Decode the header and payload to plain JSON to see the claims — without verifying the signature.
- Flatten Nested JSON — Turn a deeply nested JSON object into a flat map of dot-notation keys like user.address.city — handy for spreadsheets, env vars, and feature flags.
- How to Escape a String for JSON — Which characters must be escaped to put raw text inside a JSON string, what each escape sequence means, and how to do it reliably instead of by hand.
- JSON Pretty Print — Paste minified or messy JSON and pretty-print it with clean 2-space indentation so it is readable. Runs in your browser; copy with one click.
- JSON to TypeScript Interface — Turn a sample JSON object into a TypeScript interface: map each field to its type, mark optional fields, and handle nested objects and arrays.
- Minify JSON Online — Paste JSON and minify it to a single compact line with no spaces or newlines. Runs in your browser; copy the result with one click.
- Fix Invalid JSON — The most common reasons JSON fails to parse and exactly how to fix each: single quotes, trailing commas, comments, unquoted keys, and unescaped newlines.
- Sort JSON Keys Alphabetically — Sort the keys of a JSON object so the output is deterministic — useful for clean git diffs, cache keys, and comparing two versions of a config.
- Unescape a JSON String — Reverse JSON string escaping: convert \n to real newlines, \" to quotes, and \\ to a single backslash — recovering the original text from an escaped value.
- Validate JSON Online — Paste JSON and check whether it is valid. This validator runs in your browser, tells you the top-level type when it parses, and points to the exact line and column when it doesn't.
- Fix "Bad control character in string literal in JSON" — A raw newline, tab, or other control character is sitting inside a JSON string. Why it is illegal and how to escape it correctly.
- Fix Python "Expecting ',' delimiter" (JSONDecodeError) — json.loads raised "Expecting ',' delimiter: line X column Y" — a missing comma, a trailing comma, or an unescaped quote broke the structure. Find it fast.
- Fix Python "Invalid control character at" (JSONDecodeError) — json.loads raised "Invalid control character at: line X column Y" — a raw newline or tab is inside a JSON string. Escape it or use strict=False.
- Fix "Unexpected token o in JSON at position 1" — JSON.parse threw "Unexpected token o in JSON at position 1" because you parsed a JavaScript object, not a string. Here is why and the one-line fix.
- Fix "Unterminated string in JSON at position N" — The JSON parser hit end-of-input while still inside a string — a missing closing quote or an unescaped newline. How to find and fix it fast.