JSON Formatter & Validator

Paste, type or drop JSON to beautify it, find errors with the exact line and column, fix broken JSON in one click and convert it to YAML, CSV, XML or TypeScript. Everything runs in your browser.

  • 100% private — nothing is uploaded
  • Lossless — big numbers stay exact
  • One-click repair
  • YAML · CSV · XML · TypeScript
Popular:

Input

Waiting for JSON

Output

Your formatted JSON appears here

Paste JSON on the left, drop a .json file anywhere on the page or .

100% private — nothing is uploaded

Fix the error to see the result

How it works

Format JSON in three steps

No sign-up, no upload, no limits on how often you use it.

  1. 1

    Paste or drop your JSON

    Paste text, open a .json file, or drag a file anywhere onto the page. API responses, config files, logs and JSON Lines all work.

  2. 2

    See errors instantly

    The validator checks as you type. If something is wrong you get the exact line and column, a plain-English explanation and a one-click fix.

  3. 3

    Format, convert, copy

    Beautify or minify, sort keys, explore it as a tree or table, filter with JSONPath, or convert to YAML, CSV, XML or TypeScript — then copy or download.

Why this JSON formatter

Everything developers need — without sending data anywhere

Built for API work, debugging and config files. Fast even with 50 MB documents.

Private by design

JSON is processed in a Web Worker on your device. Our strict security policy technically blocks the page from sending your data to any server.

Errors you can understand

Exact line and column, the problem highlighted in the editor and an explanation in plain language instead of “Unexpected token”.

One-click repair

Fixes single quotes, missing or trailing commas, comments, unquoted keys, Python True/None, JSONP wrappers and truncated data.

Lossless numbers

IDs like 12345678901234567890 and long decimals are kept exactly as written. Many formatters silently change them.

Tree & table viewer

Collapse and expand huge documents, search keys and values, copy the JSONPath of any node, or browse arrays as a sortable table.

JSONPath filter

Pull out exactly what you need: $.items[*].id, recursive search with .., slices and filters like [?(@.price < 10)].

Convert anything

JSON to YAML, CSV (Excel-ready, comma or semicolon), XML, TypeScript interfaces, JSON Schema or an escaped string.

Your way

2/3/4 spaces or tabs, sorted keys, compact arrays, dark mode, font size, side-by-side or stacked layout — remembered on your device.

JSON formatter guide

JSON (JavaScript Object Notation) is the most common format for exchanging data between web services, apps and configuration files. It is easy for machines to read, but a 5,000-character API response on a single line is almost impossible for a person to scan. A JSON formatter (also called a JSON beautifier or pretty printer) adds line breaks and indentation so you can see the structure at a glance.

This tool combines a formatter, a strict JSON validator (RFC 8259 / ECMA-404), a JSON viewer and converters in one page. Unlike most online JSON tools, nothing is sent to a server — the processing code runs in your browser, which makes it safe for API keys, customer data and internal configuration.

Most common JSON errors and how to fix them

ErrorWrongCorrect
Single quotes{'name': 'Ann'}{"name": "Ann"}
Trailing comma{"a": 1, "b": 2,}{"a": 1, "b": 2}
Unquoted key{name: "Ann"}{"name": "Ann"}
Missing comma{"a": 1 "b": 2}{"a": 1, "b": 2}
Comments{"a": 1 // note}{"a": 1}
Python literals{"ok": True, "x": None}{"ok": true, "x": null}
NaN / undefined{"v": NaN}{"v": null}
Line break in string"line 1 ↵ line 2""line 1\nline 2"

Press Fix JSON and the tool repairs all of the above automatically. You can undo the repair with Ctrl+Z.

JSONPath cheat sheet

Open the filter (funnel icon above the result) and type an expression. The result updates as you type.

ExpressionReturns
$.store.nameThe name property of store
$.items[0]The first item
$.items[-1]The last item
$.items[0:5]The first five items
$.items[*].idThe id of every item
$..emailEvery email, at any depth
$.items[?(@.price < 10)]Items cheaper than 10
$.users[?(@.role == 'admin')].nameNames of all admins
$.users[?(@.email =~ /gmail/i)]Users with a Gmail address
$.items.lengthNumber of items

JSON vs YAML vs XML vs CSV

FormatBest forNestingComments
JSONAPIs, web apps, NoSQL databasesYesNo
YAMLConfig files (Docker, Kubernetes, CI)YesYes
XMLEnterprise systems, SOAP, RSS, office filesYesYes
CSVSpreadsheets (Excel, Google Sheets), data exportsNo (flattened)No

Tips

  • Keyboard: Ctrl+Enter formats, Ctrl+Shift+Enter minifies, Ctrl+F searches, Ctrl+S downloads (⌘ on Mac).
  • Excel in Europe: choose the semicolon delimiter in Settings — Excel in Germany, France, Spain and Italy uses “;” to split columns.
  • Minify before shipping: minified JSON is typically 20–40% smaller, which means faster API responses and smaller bundles.
  • Stringified JSON such as "{\"id\":1}" from logs is detected automatically — click “Unescape it”.
  • JSON Lines / NDJSON (one JSON object per line, common in logs and BigQuery exports) is validated line by line.
FAQ

Frequently asked questions

Can’t find an answer? Contact us via the link in the footer.

Is this JSON formatter free?

Yes. It is completely free, with no sign-up, no watermark and no daily limits.

Is my JSON uploaded to your server?

No. Formatting, validation, repair and conversion all run in your browser, inside a Web Worker. The page’s security policy even blocks it from sending your data anywhere. You can disconnect from the internet after the page has loaded and the tool keeps working.

How do I validate JSON?

Paste your JSON — it is checked automatically as you type (or press Validate). Valid JSON shows a green “Valid JSON” badge. If it is invalid, you see the exact line and column, the problem is underlined in the editor and you get a clear explanation of what to change.

What does “Fix JSON” repair?

Common mistakes: single quotes, missing and trailing commas, comments, unquoted property names, Python True/False/None, NaN, JSONP wrappers such as callback({…}), special quote characters copied from Word, escaped strings and truncated documents. Review the result — you can always undo with Ctrl+Z.

Why do some tools change my big numbers?

JavaScript can only store integers up to 9,007,199,254,740,991 exactly. Tools that use JSON.parse turn 12345678901234567890 into 12345678901234567000. Our lossless parser keeps every number exactly as written.

How large a file can I format?

Files up to about 50–100 MB work in modern desktop browsers; phones handle a few megabytes comfortably. For very large files live checking pauses and you press Format manually.

How do I convert JSON to CSV for Excel?

Choose CSV as the output format and download. Nested objects are flattened into columns like address.city. In Europe, select the semicolon delimiter in Settings so Excel splits the columns correctly; the UTF-8 BOM option makes accents display properly.

Can I convert JSON to TypeScript interfaces?

Yes. Choose TypeScript as the output. The generator merges all objects in arrays, marks properties that are not always present as optional and creates named interfaces for nested objects. JSON Schema (draft 2020-12) is available too.

What is JSONPath?

A query language for JSON, similar to XPath for XML. For example $.users[*].email returns every user’s email. Open the filter above the result to use it — see the cheat sheet above.

Does it work offline and on mobile?

Yes. Once the page has loaded it works without an internet connection, and the layout adapts to phones and tablets with stacked panes and touch-friendly controls.

More free, private tools

Image compressor, converters, encoders and calculators — all running in your browser.

Browse all tools