JSON Viewer & Formatter

Input Empty
0 B 1 line Ln 1, Col 1
{ }

Nothing to show yet

Paste JSON on the left, drop a .json file anywhere, or start from an example.

  • CtrlEnter Format
  • CtrlShiftEnter Minify
  • CtrlF Filter the tree

Everything runs in your browser. No data ever leaves your device.

$

Free online JSON viewer, formatter and validator

Paste a raw API response, a package.json, a GeoJSON export or a 1 MB log payload and read it in seconds. This online JSON viewer beautifies unreadable one-line JSON, flags syntax errors with the exact line and column, and renders the result as a collapsible tree you can search, filter and copy paths from.

Everything runs as JavaScript inside your own browser. There is no upload, no server round-trip, no account and no advertising — which also means the tool stays usable for API keys, customer records and other data you should never paste into a third-party service.

Open the JSON viewer ↑

What this JSON tool can do

One page replaces the half-dozen single-purpose JSON utilities you normally keep bookmarked.

JSON formatter & beautifier

Re-indent minified JSON with 2 spaces, 4 spaces or a tab, with full syntax colouring for keys, strings, numbers, booleans and null.

JSON validator & linter

Validation runs while you type. Invalid JSON shows the parser's message plus the failing line and column, so you fix the trailing comma instead of hunting for it.

Collapsible tree viewer

Expand and collapse objects and arrays, see child counts at a glance, and walk the whole structure with the arrow keys.

Search and filter

Type in the filter box to keep only the branches whose keys or values match, with every hit highlighted and counted.

JSON minifier

Strip every optional space and newline to shrink a payload before you ship it over the wire or paste it into an environment variable.

JSONPath copy

Click a key to copy its path — $.users[0].email — ready to drop into a test, a jq expression or a bug report.

Files and drag & drop

Open .json, .geojson, .map or .txt files from disk, or drop them anywhere on the page.

Fetch from a URL

Point the viewer at a REST endpoint and inspect the response directly, without leaving the browser or installing an API client.

Sort keys alphabetically

Normalise key order while formatting so two config files can be diffed line by line.

How to format JSON online in three steps

  1. Paste or open your JSON Paste JSON into the input panel on the left, drag a .json file onto the page, or fetch it straight from a URL with the Load URL button.
  2. Press Format Click Format or press CtrlEnter. The JSON is re-indented with your chosen indentation — 2 spaces, 4 spaces or a tab — and syntax highlighted.
  3. Explore, copy or download Browse the collapsible tree on the right, filter keys and values, copy any JSONPath, then copy the formatted JSON to your clipboard or download it as a .json file.

Why a client-side JSON viewer matters

Most free JSON formatters POST your text to their backend to render it. That is fine for a toy payload and a genuine problem for anything else: production API responses routinely carry bearer tokens, e-mail addresses, order histories and internal IDs. Once that text reaches someone else's server you have no way to know whether it was logged.

This viewer never makes that request. The parser, the formatter, the minifier and the tree renderer are plain JavaScript files served once and executed locally, so you can confirm the behaviour yourself with the Network tab open. Load the page, go offline, and everything still works.

Typical online JSON formatterThis JSON viewer
Sends your JSON to a server to processParses it in your browser
Ad banners and cookie consent wallsNo ads, no trackers, no cookies
Sign-up required for larger filesNo account, ~25 MB files
Breaks without a connectionWorks fully offline
Output is a plain text boxSearchable, collapsible tree with JSONPath

Beautify vs. minify: what is the difference?

Both operations produce exactly the same data — only the whitespace between tokens changes. Beautifying (also called prettifying or formatting) is for humans reading the structure. Minifying is for machines moving bytes.

Minified — 71 bytes, unreadable
{"id":42,"name":"Ada","tags":["math","code"],"active":true}
Beautified — same data, readable
{
  "id": 42,
  "name": "Ada",
  "tags": [
    "math",
    "code"
  ],
  "active": true
}

A rule of thumb: beautify while you debug, minify before you transmit. Whitespace can be a meaningful share of a small API response, and gzip does not fully erase the difference.

Common JSON errors and how to fix them

JSON is far stricter than JavaScript object literals, which is where nearly every parse failure comes from. These are the ones the validator reports most often.

Error messageCauseFix
Unexpected token } A trailing comma after the last item Remove the comma before } or ]
Unexpected token ' Single-quoted strings or keys JSON only allows double quotes: "key"
Unexpected token n A raw newline inside a string Escape it as \n
Unexpected end of JSON input A truncated payload or missing closing brace Check the response was fully received
Unexpected token N NaN, Infinity or undefined Use null, or a string
Bad escaped character A lone backslash in a Windows path Double it: "C:\\Users"
Unexpected token / Comments — // or /* */ Strict JSON has no comments; strip them

JSON syntax quick reference

JSON (JavaScript Object Notation) is a text format defined by RFC 8259. It has exactly six value types and no more.

TypeExampleNotes
Object{"a": 1}Unordered key/value pairs; keys must be double-quoted strings
Array[1, 2, 3]Ordered list; may mix types
String"hello"Double quotes only; \" \\ \/ \b \f \n \r \t \uXXXX escapes
Number-3.14e2No leading +, no hex, no NaN or Infinity
BooleantrueLowercase only
NullnullLowercase only

Things JSON does not allow

  • Comments of any kind
  • Trailing commas
  • Single quotes around strings or unquoted keys
  • Dates as a native type — encode them as ISO 8601 strings
  • undefined, functions, or JavaScript expressions

Who uses an online JSON viewer

  • Backend and API developers — read a REST or GraphQL response without piping it through jq.
  • Frontend developers — check the shape of a fixture before writing the type.
  • QA engineers — attach a readable payload and its exact JSONPath to a bug report.
  • DevOps and SRE — inspect structured logs, Kubernetes manifests converted to JSON, or Terraform state.
  • Data analysts — explore a nested export before deciding how to flatten it.
  • Students and technical writers — see how nesting works with a real document in front of them.

Keyboard shortcuts

ShortcutAction
Ctrl + EnterFormat / prettify
Ctrl + Shift + EnterMinify / compact
Ctrl + FJump to the tree filter
Ctrl + SDownload as .json
Alt + CCopy JSON
Alt + LClear the editor

Frequently asked questions

Is this JSON viewer free?

Yes. Every feature is free and unlimited. There is no account, no paywall, no ads and no daily limit on how much JSON you can format or validate.

Is my JSON data uploaded to a server?

No. Parsing, formatting, validating and minifying all happen in your browser with JavaScript. Your JSON never leaves your device, which makes the tool safe for API responses, config files, tokens and other confidential payloads.

How do I format JSON online?

Paste your JSON into the left panel and press Format, or use the keyboard shortcut Ctrl+Enter. Choose 2 spaces, 4 spaces or tab indentation first if you want a specific style.

How do I validate JSON and find the error?

Validation is continuous — as you type, the status pill shows Valid or Invalid. When the JSON is malformed the error panel reports the reason plus the exact line and column, and the offending line is highlighted in the editor.

What is the difference between beautifying and minifying JSON?

Beautifying (also called prettifying or formatting) adds indentation and line breaks so a human can read the structure. Minifying removes every optional space and newline to make the payload as small as possible for transport. Both produce the same data.

How large a JSON file can I open?

Files up to about 25 MB open comfortably on a modern desktop browser. Because the work is done locally, the real limit is your device's memory rather than an upload quota.

Can I use the JSON viewer offline?

Yes. The page is a small static site with no external dependencies, so once it is loaded you can keep formatting JSON with no network connection. You can also install it as a progressive web app.

Can I open a .json file from my computer?

Yes. Use the Open file button, or simply drag and drop a .json, .geojson, .map or .txt file anywhere onto the page. The file is read locally by the browser.

Can I load JSON from a URL or REST API?

Yes. Click Load URL and paste an endpoint. The request is made directly from your browser, so the server must send an Access-Control-Allow-Origin header. If it does not, download the response and open the file instead.

How do I copy the path to a value?

Click any key in the tree to copy its JSONPath, for example $.users[0].email. Clicking a value copies the value itself. The current path is always shown in the status bar under the tree.

Does the JSON formatter work on mobile?

Yes. The layout stacks the input and tree panels vertically on phones and tablets, and every action is available from the toolbar.

Which browsers are supported?

Any current version of Chrome, Edge, Firefox, Safari, Opera or Brave, on desktop and mobile. No plugin or extension is required.