FormatterHQ

JSON Tools

Format, validate, repair, query, compare and convert JSON in your browser. Pick a tool below or read on to find the right one for your task.

.env to JSON Converter Convert .env (dotenv) files to JSON: handles quotes, export, comments, multi-line values and ${VAR} expansion. Base64 to JSON Decode a Base64 string back to JSON, validated and pretty-printed. CSV to JSON Converter Convert CSV to JSON online for free. Get formatted JSON with types detected automatically. Excel to JSON Converter Convert Excel to JSON online for free. Get formatted JSON with types detected automatically. HTML Table to JSON Converter Convert HTML to JSON online for free. Get formatted JSON with types detected automatically. INI to JSON Converter Convert INI configuration files (php.ini, .gitconfig, setup.cfg style) to JSON with sections, arrays and typed values. jq Playground Run jq filters on JSON in your browser with real jq 1.8: live output, -r -c -s -n -S and --arg options, clear errors and a clickable cheat sheet. JSON Cleaner Clean JSON by removing null values, empty strings, empty arrays and empty objects at any depth. Optionally trim whitespace in strings. JSON Decode Online Decode JSON strings online. Convert escaped or encoded JSON text into readable, formatted JSON, similar to json_decode. JSON Deserialize Online Deserialize an escaped JSON payload into formatted JSON, then map it to typed objects in JavaScript, Python, Java or C# safely. JSON Diff - Compare JSON Compare two JSON documents semantically: find added, removed and changed keys with JSON paths, ignoring key order and formatting. JSON Editor Edit JSON online with a live tree preview, instant validation and one-click formatting, repair and minification. JSON Encode Online JSON encode text or a document into an escaped string, with each escaping rule explained and the json_encode flags that give identical output. JSON Escape JSON escape online: convert special characters into escape sequences so text is safe inside JSON. JSON Fixer & Repair Fix broken JSON automatically: add missing quotes, commas and brackets, remove comments and trailing commas, and convert Python literals. JSON Flatten Flatten nested JSON into single-level key paths like user.address.city, with dot, custom or bracket notation for arrays. JSON Formatter Format, beautify and validate JSON online. Pretty print minified JSON with 2, 3, 4 space or tab indentation and pinpoint syntax errors. JSON Graph Visualizer Visualize JSON data as a graph of connected nodes. See objects, arrays and values as a diagram of linked boxes with size badges. JSON Merge Patch (RFC 7396) Apply an RFC 7396 JSON Merge Patch to a document, or create the merge patch that turns one JSON document into another. JSON Minify Minify JSON by removing whitespace and line breaks. Shrink payloads for APIs, storage and embedding, and see the bytes saved. JSON Multiline String Converter Convert multi-line text into a valid JSON string with \n escapes, a JSON array of lines, or concatenated string literals. JSON Navigator Navigate JSON by path. Browse or filter the tree and click any key to see and copy the full path to that value. JSON Parser Parse JSON online: errors with line and column, the parsed values with their types, and the pitfalls of big integers and duplicate keys. JSON Patch Generator (Diff to Patch) Compare two JSON documents and generate the RFC 6902 JSON Patch that transforms the first into the second, with optional test ops. JSON Patch Tester (RFC 6902) Apply RFC 6902 JSON Patch operations (add, remove, replace, move, copy, test) to a document and see exactly which step fails. JSON Path Finder Click any value in a JSON tree to get its path as JSONPath, JavaScript, Python, PHP, jq or JSON Pointer — or list every path. JSON Pretty Print Pretty print JSON online with a 4-space default, 2 or 3 spaces or tabs, and see the matching JavaScript, Python, PHP and jq commands. JSON Reader Open a .json file in your browser and read it as a collapsible tree, a sortable table or a graph, with a filter to find any value. JSON Schema to Sample JSON Generate realistic fake JSON that conforms to a JSON Schema — formats, enums, ranges and required fields respected. JSON Schema to TypeScript Turn JSON Schema into TypeScript interfaces and types with optional properties, enums, $ref definitions and JSDoc comments. JSON Schema Validator Validate JSON against a JSON Schema (draft-07, 2019-09, 2020-12) with Ajv and get every error with its path and rule. JSON Serialize Online Serialize JSON into its most compact transport form, optionally wrapped as an escaped string literal for storage or messaging. JSON Sorter Sort JSON keys alphabetically at every level, ascending or descending. Optionally sort arrays of values for clean, comparable output. JSON Stringify Online Stringify JSON into an escaped string literal, exactly like JSON.stringify. Ready to embed JSON inside JSON, code or config values. JSON Syntax Highlighter Syntax highlight JSON with light, dark or Monokai themes and copy the colourised HTML for blogs, docs and slides. JSON to .env Converter Turn JSON configuration into .env KEY=value lines with nested keys joined by __ and values quoted safely. JSON to Base64 Convert JSON to a Base64 string online. UTF-8 safe, validates the JSON first; paste text or upload a .json file. JSON to C# Generate C# classes with JsonProperty attributes from a JSON sample instantly, with nested types detected automatically. JSON to C++ Generate C++ classes with nlohmann::json helpers from a JSON sample instantly, with nested types detected automatically. JSON to Crystal Generate Crystal classes with JSON mapping from a JSON sample instantly, with nested types detected automatically. JSON to CSV Converter Convert JSON to CSV online for free. Nested data is flattened into columns. JSON to Dart Generate Dart classes with fromJson and toJson from a JSON sample instantly, with nested types detected automatically. JSON to Elm Generate Elm type aliases with decoders from a JSON sample instantly, with nested types detected automatically. JSON to Excel Converter Convert JSON to Excel online for free. Download a real .xlsx workbook generated in your browser. JSON to Flow Generate Flow Flow type definitions from a JSON sample instantly, with nested types detected automatically. JSON to Go Generate Go structs with json tags from a JSON sample instantly, with nested types detected automatically. JSON to Haskell Generate Haskell records with Aeson instances from a JSON sample instantly, with nested types detected automatically. JSON to HTML Table Converter Convert JSON to HTML online for free. Get clean table markup with a live preview. JSON to INI Converter Convert JSON objects to INI files: nested objects become [section] and [section.sub] headers, arrays become key[] lines. JSON to Java Generate Java POJO classes with getters and setters from a JSON sample instantly, with nested types detected automatically. JSON to JavaScript PropTypes Generate JavaScript PropTypes React PropTypes definitions from a JSON sample instantly, with nested types detected automatically. JSON to JSON Schema Generate JSON Schema a JSON Schema document from a JSON sample instantly, with nested types detected automatically. JSON to JSONL Converter Convert a JSON array to JSON Lines (JSONL / NDJSON), one record per line, for streaming, logging, BigQuery and ML datasets. JSON to Kotlin Generate Kotlin data classes from a JSON sample instantly, with nested types detected automatically. JSON to Laravel Model & Migration Generate a Laravel Eloquent model ($fillable, casts, relations) and a matching migration from a sample JSON record. JSON to Mongoose Schema Generate a Mongoose schema and model from a sample JSON document, detecting Date, ObjectId, arrays and nested objects. JSON to Objective-C Generate Objective-C classes with properties from a JSON sample instantly, with nested types detected automatically. JSON to One Line Convert multi-line JSON to a single line. Collapse formatted JSON for logs, CLI arguments, environment variables and CSV cells. JSON to PHP Generate PHP classes with typed properties from a JSON sample instantly, with nested types detected automatically. JSON to PHP Array Converter Convert JSON to a PHP array literal with short [] or array() syntax, ready to paste into Laravel config files, seeders and tests. JSON to Pike Generate Pike classes from a JSON sample instantly, with nested types detected automatically. JSON to Properties Converter Convert JSON into Java .properties key=value lines with dotted keys and correct escaping of special and non-ASCII characters. JSON to Python Generate Python dataclasses with type hints from a JSON sample instantly, with nested types detected automatically. JSON to Query String Build URL-encoded query strings from JSON objects, with a choice of bracket, indexed or repeated keys for arrays. JSON to Ruby Generate Ruby Dry::Struct classes from a JSON sample instantly, with nested types detected automatically. JSON to Rust Generate Rust structs with Serde derives from a JSON sample instantly, with nested types detected automatically. JSON to Scala Generate Scala case classes from a JSON sample instantly, with nested types detected automatically. JSON to SQL Converter Convert JSON to SQL online for free. CREATE TABLE and INSERT statements with escaped values. JSON to String Converter Convert JSON to a single escaped string you can paste into code, databases or other JSON documents. Choose double, single or no quotes. JSON to Swift Generate Swift Codable structs from a JSON sample instantly, with nested types detected automatically. JSON to Text Converter Convert JSON to Text online for free. Readable key: value output for reports and tickets. JSON to TOML Converter Convert JSON to TOML online for free. Tables and arrays of tables are generated for you. JSON to TSV Converter Convert JSON to TSV online for free. Paste the result straight into a spreadsheet. JSON to TypeScript Generate TypeScript interfaces from a JSON sample instantly, with nested types detected automatically. JSON to XML Converter Convert JSON to XML online for free. Attributes, arrays and root element are configurable. JSON to YAML Converter Convert JSON to YAML online for free. Clean, readable YAML with configurable indentation. JSON to Zod Schema Generate a Zod validation schema for TypeScript from a JSON sample. JSON Tree Viewer Display JSON as an expandable tree. Collapse and expand objects and arrays to understand deeply nested data structures. JSON Unescape JSON unescape online: turn escaped sequences back into readable plain text instantly. JSON Unflatten Rebuild nested JSON from flat dot-notation keys (a.b.c) or bracket paths (a[0].b), the reverse of JSON flatten. JSON URL Decode Decode a URL-encoded JSON string back into readable JSON and pretty-print it. JSON URL Encode URL-encode JSON so it can be sent as a query-string parameter or form field without breaking the URL. JSON Validator Validate JSON online and find syntax errors fast. Get the exact line and column of each problem and fix broken JSON in one click. JSON Viewer & Beautifier View JSON as a collapsible tree and beautify it at the same time. Explore nested objects and arrays without losing your place. JSON5 Formatter Format and beautify JSON5 with comments, unquoted keys and trailing commas, or convert JSON5 to strict JSON. JSON5 Validator Validate JSON5 syntax online. Check config files with comments and trailing commas and get line and column for each error. JSONL to JSON Converter Convert JSON Lines (JSONL / NDJSON) into a formatted JSON array. Invalid lines are reported with their line number. JSONPath Tester Test JSONPath expressions online against your JSON. Supports filters, wildcards, recursive descent and slices, returning values or paths. JWK to PEM Converter Convert JSON Web Keys or a whole JWKS (RSA, EC, OKP) into PEM public (SPKI) and private (PKCS#8) keys. OPML to JSON Converter Convert OPML to JSON online for free. Get formatted JSON with types detected automatically. PEM to JWK Converter Convert PEM public keys, private keys and certificates (RSA, EC, Ed25519) to JSON Web Keys or a JWKS with a thumbprint kid. Properties to JSON Converter Convert Java .properties files (Spring Boot, i18n bundles) to nested or flat JSON, decoding \uXXXX escapes and line continuations. Query String to JSON Parse URL query strings into JSON, including repeated keys, PHP/Rails bracket arrays (a[]=1) and nested objects (a[b][c]=1). Random JSON Generator Generate realistic fake JSON test data — names, emails, addresses, dates and more — with custom fields. RSS to JSON Converter Convert RSS to JSON online for free. Get formatted JSON with types detected automatically. SQL to JSON Converter Convert SQL to JSON online for free. Get formatted JSON with types detected automatically. String to JSON Converter Convert an escaped JSON string back into formatted JSON. Handles quoted literals, backslash-escaped text and double-encoded JSON. TOML to JSON Converter Convert TOML to JSON online for free. Get formatted JSON with types detected automatically. TSV to JSON Converter Convert TSV to JSON online for free. Get formatted JSON with types detected automatically. XML to JSON Converter Convert XML to JSON online for free. Get formatted JSON with types detected automatically. YAML to JSON Converter Convert YAML to JSON online for free. Get formatted JSON with types detected automatically.

JSON tools for every step of working with data

JSON (JavaScript Object Notation) is the default data format of web APIs, configuration files and many databases. It is easy for machines to parse, but a single missing comma or an unreadable one-line response can cost minutes of squinting. These JSON tools cover the whole workflow: making JSON readable, checking and repairing it, finding values inside it, comparing versions and converting it into other formats or typed code.

Which JSON tool do you need?

  • Read or tidy a document – the JSON formatter indents and validates in one step, and the JSON viewer shows a collapsible tree for large responses.
  • Find out why JSON is invalid – the JSON validator reports the exact line and column of each error. If the file came from a log or a JavaScript object, the JSON fixer repairs trailing commas, single quotes and unquoted keys.
  • Make it smaller – JSON minify removes all insignificant whitespace for transport or storage.
  • Extract values – the JSONPath tester evaluates expressions such as $.orders[*].total.
  • Compare two versions – JSON diff compares structure rather than text, so key order and formatting do not create false differences.
  • Change format – JSON to CSV flattens arrays of objects into spreadsheet rows, while JSON to YAML and JSON to XML cover configuration and legacy systems.
  • Generate code – JSON to TypeScript and the other data-to-class generators infer types from a sample response.

Common workflows

Debugging an API response: paste the raw response into the formatter, collapse the parts you do not need in the viewer, and use JSONPath to pull out the value you are checking. When a response changes between releases, JSON diff shows exactly which fields were added, removed or modified, with their paths.

Preparing data for a spreadsheet: validate the file, then convert it to CSV. Nested objects are flattened into dotted column names, so the structure is still recognizable in Excel or Google Sheets.

Creating typed models: take a representative sample (one that includes optional fields), convert it to classes for your language, then review the inferred types. A single sample cannot tell whether a field can be null, so adjust those by hand.

Tips for working with JSON

  • Standard JSON does not allow comments, trailing commas or single-quoted strings. If a file uses them, it is JSON5 or JSONC, which several tools here accept too.
  • Numbers larger than about 9 × 1015 lose precision in JavaScript. Keep large IDs as strings.
  • Always validate JSON produced by string concatenation; building JSON with a serializer avoids escaping errors.
  • Most tools process data locally in your browser, so API responses containing personal data are not uploaded.

Need test data first? The random JSON generator creates realistic fake records.

Frequently asked questions

What is the difference between a JSON formatter and a JSON validator?
A formatter re-indents JSON to make it readable and usually validates it at the same time. A validator focuses on finding errors and reporting their exact position without necessarily changing the layout.
Can these tools handle large JSON files?
Yes, within the limits of your browser’s memory. Files of several megabytes format quickly; for very large files the tree viewer is easier to navigate than plain text.
Is my JSON uploaded to a server?
The JSON tools run in your browser, so the data you paste stays on your device.
Why is my JSON invalid when it works in JavaScript?
JavaScript object literals allow single quotes, unquoted keys, comments and trailing commas, but strict JSON does not. The JSON fixer converts such input into valid JSON.
How do I convert JSON to Excel?
Use the JSON to Excel or JSON to CSV converter. Arrays of objects become rows, and nested fields are flattened into columns.