About jsonfmt.dev

Built for privacy.
Runs entirely in your browser.

jsonfmt.dev is a free JSON toolkit with 7 tools: formatter, diff, converter, JWT decoder, repair, schema validator, and JSONPath evaluator. Every feature runs locally in your browser with zero network requests for your data.

🔒

No Server

Your JSON is never uploaded. All processing happens on your device — it can't reach our servers because there are none.

Zero Dependencies

No frameworks, no npm packages, no CDN calls. The entire tool is a single self-contained HTML file.

📡

Works Offline

Load the page once and it works forever — even with no internet connection. Bookmark it and use it anywhere.

A custom-built JSON parser, written from scratch

We didn't use JSON.parse(). The heart of jsonfmt.dev is a hand-written Lexer → Parser → AST pipeline built entirely in JavaScript. This gives us precise error locations (line and column), syntax highlighting, collapsible tree views, and the ability to handle malformed input gracefully — things the native browser parser simply can't do.

The same parser powers every tab: formatting, diffing, tree view, conversion, and repair. The repair tab applies six sequential transforms before parsing to recover from common mistakes — trailing commas, single quotes, unquoted keys, JavaScript comments, and undefined values.

Every tool a developer needs for JSON

Format & Beautify Pretty-print with 2-space, 4-space, or tab indentation. Optional key sorting and depth control.
Validate Strict RFC 8259 validation with precise line and column error reporting.
Minify Strip all whitespace for compact payloads. One click, instant result.
Tree View Lazy-rendered collapsible tree — handles deeply nested structures without freezing.
Diff Compare two JSON documents. Highlights added, removed, and changed fields by path.
Convert Transform JSON to YAML, CSV, XML, or TypeScript interfaces — all converted locally, no upload required.
JWT Decoder Decode and inspect JWT tokens. Header, payload, and expiry status — entirely offline.
Repair Fix broken JSON: trailing commas, unquoted keys, JS comments, single quotes, undefined values.
JSON Schema Validator Validate JSON against a schema definition. Supports type, required, properties, allOf, anyOf, oneOf, $ref, and more.
JSONPath Evaluator Query JSON with JSONPath expressions — $.store.book[*].author, filter expressions, recursive descent, and slices.
JSON → TypeScript Generate TypeScript interface definitions from any JSON object. Nested objects produce nested interfaces automatically.
Tree View with JSONPath Collapsible tree view with lazy rendering. Click any node to copy its JSONPath to the clipboard.
Dark & Light Theme Toggle between dark and light mode. Preference is saved in localStorage and applied instantly.
Drag & Drop Drop a .json file anywhere on the page to load it instantly — no file picker required.
Search in Output Press ⌘F to search within formatted output. Navigate matches with ↑↓ arrows, exact like a code editor.
PWA — Works Offline Installable as a Progressive Web App. A service worker caches the entire tool so it works with no internet connection.
Share Links Encode your JSON into a URL hash and share it — the data lives in the URL fragment, never on a server.
Keyboard Shortcuts Full keyboard control: format, minify, copy, share, switch 7 tabs — press ? for the list.

Your data never leaves your device

Secure by architecture, not by policy

  • No backend server — there is nowhere for your data to go
  • No WebSocket, no fetch, no XHR for your JSON content
  • Share links encode data in the URL fragment (#v1:…) — the fragment is never sent to a server
  • JWT decoding is done locally — your token stays in your browser
  • No account, no login, no cookies tied to you
  • Works fully offline after the initial page load

Ready to format some JSON?

Free forever. No signup. No ads on mobile. Works offline.

Open the formatter

Why we built jsonfmt.dev

jsonfmt.dev was created out of frustration with JSON tools that sent your data to their servers. Every time a developer pasted a production API response — containing user data, authentication tokens, or internal system information — into a server-based JSON formatter, they created an unnecessary data exposure risk. The core premise of jsonfmt.dev is simple: a JSON formatter does not need a server. All the processing can and should happen in your browser.

The technical foundation is a custom Lexer and Parser built in pure JavaScript. The Lexer tokenizes raw JSON text into a stream of typed tokens; the Parser consumes that stream and builds an Abstract Syntax Tree (AST). The AST is then traversed by Formatter, Diff, Stats, and Converter modules to produce the desired output. This architecture — identical to how compilers work — enables accurate error reporting, structure-aware formatting, and semantic diff computation entirely client-side.

The single-file constraint for web/index.html is intentional. A single HTML file has zero dependencies: no CDN calls that might be blocked by corporate firewalls or ad blockers, no build step required to view the source, and no risk of supply-chain attacks through compromised npm packages. The entire tool is self-contained — copy the file to your local machine, open it in any browser, and it works identically to the hosted version, fully offline.

Performance has been a priority from the beginning. The PageSpeed score of 99/100 on mobile reflects deliberate choices: no external fonts (system font stack), no third-party analytics that block rendering, inline critical CSS, and deferred non-critical JavaScript. Large JSON files (over 100KB) are offloaded to Web Workers to keep the main thread responsive. The result is a tool that feels instantaneous even on modest hardware and slow network connections.

The feature set grew organically from user needs. The initial version formatted JSON. Users asked for diff. Then validation. Then YAML conversion. Then TypeScript type generation. Each feature was added only when there was clear demand and when a high-quality client-side implementation was achievable. The current 33 converters, 8 tabs, and 4 view modes represent years of incremental, user-driven development — not a feature dump from a product roadmap.

The REST API at api.jsonfmt.dev exposes the same Lexer → Parser → AST core as the web tool, enabling programmatic access for CI/CD pipelines, testing frameworks, and automation scripts that need JSON processing capabilities without running a browser. The 63 API endpoints cover the same operations as the web UI, with the same input quality (the same repair algorithm, the same converter logic) but accessible via HTTP for server-side workflows.

The MCP (Model Context Protocol) server extends the tool to AI agents. As AI coding assistants become part of developer workflows, they need tools to process JSON data on behalf of users. The jsonfmt MCP server exposes 21 tools — format, validate, repair, diff, convert, and more — that AI agents can call to process JSON within their workflows. Published as the jsonfmt-mcp npm package, it enables any MCP-compatible AI client to use professional JSON processing capabilities.

What jsonfmt.dev offers

Web formatter with 8 specialized tabs The main tool at jsonfmt.dev provides Format, Diff, Convert, JWT, Repair, Schema, Path (JSONPath), and JSONL tabs — each optimized for a specific JSON workflow. All tabs share the same underlying parser, ensuring consistent behavior across all operations.
33 format converters Convert JSON to TypeScript, Go, Python, YAML, CSV, XML, SQL, GraphQL, Protobuf, Zod, and 23 more formats. Each converter is purpose-built — not a generic template substitution — producing idiomatic output in the target language or format's conventions.
REST API with 63 endpoints The API at api.jsonfmt.dev provides programmatic access for CI/CD integration, testing frameworks, and automation scripts. All endpoints share the same core processing logic as the web UI, with free-tier access requiring no API key for basic operations.
MCP server for AI agents The jsonfmt-mcp npm package exposes JSON processing capabilities to AI coding assistants through the Model Context Protocol standard. Agents can format, validate, repair, diff, and convert JSON as part of their assistance workflows without leaving the AI environment.

How jsonfmt.dev is built and maintained

Frequently asked questions about jsonfmt.dev

Is jsonfmt.dev open source?

The core architecture — Lexer, Parser, AST, Formatter — is visible in the single-file web tool at jsonfmt.dev. The implementation is not published on GitHub as open source, but the single-file architecture means the complete client-side code is always readable in your browser's View Source. This "readable by design" approach provides transparency without the maintenance overhead of a public repository.

How is jsonfmt.dev funded?

jsonfmt.dev is supported by Google AdSense advertisements displayed on landing pages. The core tool at jsonfmt.dev remains ad-free. The REST API is free for basic use with rate limits; pro tier access (for teams with higher volume needs) provides increased rate limits. The tool is built and maintained as a side project with the goal of providing high-quality, privacy-respecting JSON tooling to the developer community.

Does jsonfmt.dev collect any analytics data?

The landing pages use Google Analytics (G-DXKNV8RRNT) for page view metrics. The main tool at jsonfmt.dev uses minimal analytics that collect only aggregate usage metrics — no JSON content, no personal data. All analytics data is anonymized. The full data handling details are documented in the privacy policy at jsonfmt.dev/privacy.

How do I report a bug or request a feature?

Bug reports and feature requests can be sent to the contact email listed on the privacy and terms pages. When reporting a bug, include the type of JSON that triggered the issue (a minimal reproducing example with sensitive data removed), the expected behavior, and the actual behavior you observed. Feature requests are evaluated based on user demand, client-side feasibility, and alignment with the privacy-first architecture.