Open tools · 0

About

JSON Formatter

Paste JSON, open a file or drop one on the window, and it is checked as you type. Most formatters go through the browser’s own parser and quietly rewrite what they are given: a 64-bit id rounded, 1.0 turned into 1, a duplicate key dropped. This one keeps every number as it was written and changes nothing but the whitespace.

What it does

  • Validates as you type: a mistake is reported with its line, its column and a plain reason, with Go to error.
  • Repairs the usual suspects in one click: comments, trailing commas, unquoted keys, single quotes, Python’s True and None, a code fence, a JSONP callback.
  • Formats with 2, 3 or 4 spaces or tabs, minifies to one line, and sorts keys from A to Z, recursively.
  • Escapes the document into a string literal for your code, or unescapes one back.
  • A tree view that folds large documents, searches keys and values, and copies the JSONPath of any node.
  • Keeps numbers exactly as written, and flags duplicate keys instead of dropping one.
  • Shows the size, the key count and the depth; open, drop, copy and download.

How to use it

  1. Paste the JSON, open a file, or drop one on the window.
  2. Read the error if there is one, and press Repair or fix it at the line it names.
  3. Choose the indent, or Minify, Sort keys or Escape.
  4. Copy the result, download it, or switch to the tree to explore it.

What it does not do

  • Loading from a URL: the page is not allowed to reach other sites, which is also what keeps a pasted token on your machine.
  • Saving or sharing online: that needs a server, and the point is that nothing is sent to one.
  • Remembering the last document: people paste tokens and customer data here, so only the preferences are kept.
  • JSON Schema, JSONPath queries and JSON to CSV: separate jobs from formatting.

Questions

Why did another formatter change my numbers?

It read the document into JavaScript numbers, which hold about 16 significant digits, and printed them back, so a 20-digit id ends in zeros. This tool never turns a number into a number type; it copies the digits as written.

What does Repair fix, exactly?

Comments, trailing commas, single quotes, unquoted keys, Python constants, a truncated document, a code fence and a JSONP wrapper. It cannot invent a value that is missing.

Is a duplicate key an error?

The specification allows it and leaves its meaning open; most parsers keep the last one. It is flagged here, not removed, so you decide.

Can it handle a large document?

Yes. Formatting changes only the whitespace, so it is quick, and the tree folds what you are not looking at.

Everything here runs in your browser. Nothing you type, paste or open is uploaded, and there is no account and no queue. How that works.

Often used with

  • JSON, YAML, XML & TOML: the same document in YAML, XML or TOML, numbers kept the same way
  • CSV Viewer & Editor: a JSON list opened as a table and saved as CSV or Excel
  • Text Compare: two versions formatted here first, so the diff shows the change and not the whitespace

More in Dev Tools

  • Regex Tester: Test JavaScript regular expressions live: highlighted matches, capture groups, replace, and a plain-English explanation.
  • Hash Generator: Hash text or files with MD5, SHA-1, SHA-2, SHA-3, BLAKE3, CRC-32 and more; verify a checksum; compute an HMAC.
  • Unix Timestamp Converter: Turn Unix timestamps in seconds, milliseconds or nanoseconds into dates and back, many at once, with Excel, Windows and Discord times too.
  • JWT Decoder: Decode a JSON Web Token, read every claim and its dates, and verify the signature with a secret, a PEM or a key set, told why when it fails.
  • URL Encode & Decode: Percent-encode or decode text for a URL with the kinds of escaping told apart, and take a link apart: edit its query, strip its tracking, see its real host.
  • Cron Expression Parser: Read a cron expression in plain English, see its next runs in any time zone and what a clock change does to them, or build one; Unix, Spring, Quartz and EventBridge.

All toolsAbout utilbrewPrivacy