JSON Formatter & Validator

Format, validate, repair & convert JSON. Private, in your browser.

Input

Output

Ready
Ln 1, Col 1

Everything you need to work with JSON

A fast, private JSON toolkit for developers. No sign-up, no uploads, no tracking.

Beautify & format

Pretty-print JSON with 2 spaces, 4 spaces or tabs, and optionally sort keys alphabetically.

Validate with exact errors

See the line and column of every syntax error, the highlighted line and a plain-English explanation.

Repair broken JSON

Fix trailing commas, comments, single quotes, unquoted keys, Python literals and unclosed brackets in one click.

Tree & code views

Fold and unfold any object or array, or switch to a line-numbered, syntax-highlighted code view.

Search & JSON paths

Find keys and values instantly, and click any row to copy its path, such as $.users[0].email.

Convert formats

Turn JSON into YAML, CSV, XML or JSON Schema, or escape and unescape JSON strings.

Code in 11 languages

Generate TypeScript, Go, Java, Kotlin, Swift, Dart, C#, C++, C, PHP or Python types straight from a JSON sample.

JSONPath queries

Type $.users[?(@.active)].email in the search box to extract exactly the values you need.

CSV to JSON

Switch the input to CSV to turn spreadsheets into JSON, with automatic number, boolean and nested-key handling.

JSON Schema generator

Infer a draft 2020-12 schema with types, required fields and formats like email, date-time and uri.

Hidden-problem warnings

Get warned about duplicate keys and large numbers that silently lose precision in JavaScript.

Share links

Copy a link that contains your JSON, compressed into the URL itself, so nothing is stored on a server.

100% private

Everything runs in your browser. Your data is never uploaded, so it is safe for tokens and API responses.

Works offline

After your first visit the tool keeps working without a connection, and you can install it as an app.

Keyboard friendly

Shortcuts for every action, smart indentation in the editor, and full keyboard navigation.

Dark mode

Follows your system theme automatically, or pick light or dark yourself. Your choice is remembered.

What is JSON?

JSON (JavaScript Object Notation) is a lightweight, text-based data format for exchanging information between servers and applications. It is the standard format for web APIs and is widely used for configuration files and data storage in every major programming language.

JSON syntax in a nutshell

JSON is built from objects and arrays. Objects are wrapped in curly braces {} and hold key–value pairs separated by colons. Arrays are wrapped in square brackets [] and hold comma-separated values. Keys must be double-quoted strings; values can be strings, numbers, true, false, null, objects or arrays.

How to format JSON online

  1. Paste JSON into the Input panel, open a file, or drop a .json file onto it.
  2. Click Format or press Ctrl+Enter (⌘+Enter on Mac). Input is also formatted automatically as you type.
  3. Browse the result as a Tree or as Code. Search it, fold nodes, or click a row to copy its JSON path.
  4. Copy the result, Download it as a file, or share a link.

JSON validator with exact error locations

Your input is checked with the browser's standards-compliant JSON parser. If something is wrong you get the line and column, the line is highlighted in the editor, and a hint explains the likely cause. Click Go to error to jump straight to it.

Common JSON errors

  • Trailing commas: [1, 2, 3,] is not valid JSON.
  • Single quotes: strings and keys must use double quotes.
  • Unquoted keys: {name: "Alice"} must be {"name": "Alice"}.
  • Comments: JSON does not allow // or /* */ comments.
  • Missing brackets: every { and [ needs a matching close.

Repair invalid JSON automatically

Copied JSON from a JavaScript file, a log or a Python script? Click Repair and the tool rewrites it as valid JSON. It removes comments and trailing commas, adds missing commas, converts single and curly quotes, quotes bare keys, turns True/False/None into JSON literals, closes unclosed brackets and strips JSONP or const x = wrappers.

You can undo a repair with Ctrl+Z. Always check the result before relying on it.

Convert JSON to YAML, CSV, XML and code

  • JSON to YAML: readable YAML for configuration files such as Kubernetes or CI pipelines.
  • JSON to CSV: arrays of objects become rows; nested fields are flattened into columns like address.city.
  • JSON to XML and JSON Schema: well-formed XML, or a schema with types, required fields and formats.
  • JSON to code: TypeScript interfaces, Go structs, Java records, Kotlin data classes, Swift Codable, Dart, C#, C++, C, PHP and Python classes, with optional fields detected across array items.

Query JSON with JSONPath

Start typing with $ in the search box to run a JSONPath query. The output shows only the matching values, and every conversion works on the result, so you can pull $.users[*] out of a large response and export just that as CSV.

  • $.store.book[0].title: a single value
  • $..price: every price at any depth
  • $.items[?(@.price < 10)]: items matching a filter
  • $.users[-2:]: the last two users

JSON minifier

Click Minify to strip all unnecessary whitespace and line breaks while keeping the data identical. Minified JSON is smaller, so it transfers faster, which makes it ideal for API payloads and production builds. The status bar shows exactly how many bytes you saved.

Private, fast and works offline

Your JSON never leaves your device. All formatting, validation, repair and conversion happens locally in your browser, so it is safe to use with API responses, tokens and configuration files. There is no sign-up and no server round-trip, and after your first visit the tool keeps working even without an internet connection. Install it as an app from your browser's menu for one-click access.

All JSON tools

Every tool runs in your browser. Pick one to open it with the right settings.

Frequently asked questions

What is a JSON formatter?

A JSON formatter takes raw or minified JSON and re-prints it with consistent indentation and syntax highlighting, so it is easy to read and debug. It also validates the JSON and reports any syntax errors.

Is my JSON data sent to a server?

No. Easy JSON Formatter runs entirely in your browser. Your JSON is never uploaded, logged or stored on a server. Share links keep the data inside the link itself.

How do I format JSON?

Paste your JSON into the Input panel, open a .json file, or drop a file onto the page, then click Format or press Ctrl+Enter (Cmd+Enter on Mac). The result appears in the Output panel as a collapsible tree or as highlighted code.

How do I find the error in invalid JSON?

When JSON is invalid, the Output panel shows the line and column where parsing failed, highlights that line in the editor, shows a snippet of the surrounding text and explains the likely cause, such as a trailing comma or a missing quote.

Can it fix broken JSON automatically?

Yes. Click Repair to fix common problems: comments, trailing or missing commas, single quotes, unquoted keys, Python-style True, False and None, NaN and unclosed brackets. Always review the result before using it.

Can I convert JSON to CSV, YAML, XML or TypeScript?

Yes. Choose a format from the Convert menu. Arrays of objects become CSV rows with nested fields flattened into dot-separated columns, and the TypeScript option generates interfaces from your data.

Can I generate classes or structs from JSON?

Yes. The Convert menu generates ready-to-use types for TypeScript, Go, Java, Kotlin, Swift, Dart, C#, C++, C, PHP and Python, plus a JSON Schema. Optional and nullable fields are detected from your sample data, and keys are mapped with each language's standard serialization annotations.

How do I query JSON with JSONPath?

Type a JSONPath expression starting with $ into the search box, for example $.users[*].email or $..price or $.items[?(@.price < 10)]. The output shows only the matching values, and you can convert or download them.

Can I convert CSV to JSON?

Yes. Switch the Input panel from JSON to CSV, or open a .csv file. The first row becomes the keys, numbers and true/false are converted automatically, and dotted headers such as address.city become nested objects.

Can I minify JSON?

Yes. Click Minify to remove all unnecessary whitespace and produce compact, single-line JSON that you can copy or download. The status bar shows how much smaller it is.

How do I share formatted JSON?

Click the link icon in the Input panel to copy a share link. The JSON is compressed into the link itself, so it never touches a server, and anyone who opens the link sees the same data.

Is Easy JSON Formatter free?

Yes, it is completely free with no sign-up. It works offline after your first visit and can be installed as an app.