The JSON Validator, Formatter, and Toolkit for Developers
JSONLint is an online JSON validator, formatter, converter, and learning toolkit. It combines a multi-diagnostic parser, more than 40 browser-based tools, JSON Schema support, error-code references, practical guides, and free datasets.
Chrome Extension: Check out our JSON Formatter Chrome Extension for formatting JSON directly in your browser. (GitHub Repo)
The main validator is powered by @jsonlint/core, the open-source diagnostics engine extracted from JSONLint. One pass returns every error and warning with stable codes, precise offsets, and line/column locations.
npm install @jsonlint/coreJSONLint documents all 34 diagnostics at jsonlint.com/errors, with an explanation, invalid and corrected examples, and a suggested fix for each code.
Validators & Formatters
- JSON Validator β Reports every error and warning in one pass, with stable diagnostic codes, precise line/column locations, and linked explanations
- Pretty Print β Format JSON with customizable indentation (2/4 spaces, tabs)
- Minify β Compress JSON by removing all whitespace
- JSON Sorter β Sort object keys alphabetically (ascending/descending)
- Escape/Unescape β Escape JSON for embedding in strings or unescape stringified JSON
- Stringify β Convert JSON to escaped string format
- JSON Repair β Auto-fix broken JSON (trailing commas, single quotes, comments, truncated data)
- JSONC to JSON β Strip comments and trailing commas from JSONC/JSON5 files
- Error Analyzer β Detailed error explanations with suggestions and auto-fix
Viewers & Query Tools
- Tree Viewer β Interactive collapsible tree visualization with color-coded types
- Table Viewer β Display JSON arrays as sortable HTML tables
- JSON Diff β Compare two JSON objects with highlighted differences
- JSON Path Query β Extract data using JSONPath expressions
- JSON Search β Find keys and values with full-text search
- Size Analyzer β Analyze JSON size, depth, and structure complexity
- Flatten/Unflatten β Convert nested JSON to dot notation and back
LLM & AI Tools
- Token Counter β Count tokens for GPT-4, Claude, and other LLMs
Encoding Tools
- Base64 Encode/Decode β Encode JSON to Base64 or decode Base64 to JSON
- JWT Decoder β Decode and inspect JWT tokens (header, payload, signature)
Data Converters
| From | To |
|---|---|
| JSON | CSV, Excel, YAML, XML, SQL, Markdown |
| CSV | JSON |
| Excel | JSON |
| YAML | JSON |
| XML | JSON |
| SQL (INSERT) | JSON |
Code Generators Generate typed, production-ready code from JSON:
- TypeScript β Interfaces with optional/required properties
- Python β Dataclasses with type hints
- Java β POJOs with Jackson/Gson annotations
- C# β Classes with JsonProperty attributes
- Go β Structs with json tags
- Kotlin β Data classes with kotlinx.serialization/Moshi/Gson
- Swift β Codable structs with CodingKeys
- Rust β Serde-compatible structs with derive macros
- PHP β Classes with typed properties (PHP 8+)
Schema Tools
- Schema Validator β Validate against JSON Schema Draft 7, 2019-09, or 2020-12; the validator selects the matching Ajv implementation from
$schema - Schema Generator β Auto-generate JSON Schema from sample data
JSONLint provides 47 free, open-source JSON datasets for testing, learning, and development:
- Reference Data β Countries, languages, currencies, timezones, HTTP status codes
- Development β Programming languages, file extensions, config templates (package.json, tsconfig, ESLint)
- Mock Data β Users, products, orders, transactions, comments, notifications
- Geography β US states, continents, airports, mountains
- Fun β Emojis, emoticons, colors, lorem ipsum
Browse all datasets at jsonlint.com/datasets
- Monaco Editor (VS Code's editor engine) with Shiki syntax highlighting
- Syntax highlighting and bracket matching
- Error highlighting on specific lines
- Drag and drop file upload
- Copy to clipboard
- Keyboard shortcuts (Ctrl/Cmd+Enter to validate, Ctrl/Cmd+Shift+F to format)
- Dark/light theme with system detection
- Full-width toggle for larger workspaces
- IME support for Chinese (Bopomofo/Zhuyin), Japanese, and Korean input
- Mobile responsive
The validator provides structured feedback beyond a single JSON.parse() exception:
- Multi-diagnostic parsing β Reports all detectable errors and warnings in one pass
- Stable error codes β Links each diagnostic to a dedicated
/errors/{CODE}reference page - Helpful hints β Covers uppercase literals, single quotes, unquoted keys, invalid escapes, missing separators, and more
- JSONC-aware guidance β Recognizes comments and trailing commas and suggests the appropriate conversion tools
- Warnings β Flags duplicate keys, precision loss, lone surrogates, and suspicious Windows-path escapes without marking otherwise-valid JSON as invalid
- Preserves formatting β Validation doesn't modify your input (no more 1.0 β 1 conversion)
π JSON documents are processed entirely in your browser. Document contents are never included in telemetry or sent to JSONLint's servers.
To improve the validator, JSONLint records a document-free 10% sample containing only aggregate signals: document length, diagnostic count and codes, validation result, mode, and engine latency. The collector clamps and allowlists every field before writing to Cloudflare Analytics Engine. See lib/shadow-telemetry.ts and workers/shadow/README.md.
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Editor: Monaco Editor with Shiki syntax highlighting
- JSON syntax validation: @jsonlint/core
- JSON Schema validation: Ajv 8 with draft-specific 7, 2019-09, and 2020-12 builds
- Utilities: jsonpath-plus, fast-xml-parser, diff, and jsonrepair
# Clone the repository
git clone https://github.com/circlecell/jsonlint.git
cd jsonlint
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Start production server
npm startVisit http://localhost:3000 to see the app.
Create a .env.local file:
NEXT_PUBLIC_BASE_URL=https://jsonlint.comjsonlint/
βββ app/ # Next.js App Router pages
β βββ page.tsx # Home (JSON Validator)
β βββ tools/ # Tools directory page
β βββ datasets/ # Datasets directory page
β βββ learn/ # Learning resources
β βββ errors/ # Diagnostic index and 34 error-code pages
β βββ json-to-csv/ # Converter tools
β βββ json-to-typescript/ # Code generators
β βββ json-schema/ # Schema tools
β βββ json-formatter/ # Formatter and Chrome-extension landing page
β βββ jwt-decoder/ # JWT decoder tool
β βββ json-base64/ # Base64 encode/decode
β βββ about/ # About page
β βββ sitemap.ts # Dynamic sitemap generator
β βββ [...slug]/ # Dynamic content pages
βββ components/ # React components
β βββ Header.tsx # Site header with navigation
β βββ Footer.tsx # Site footer
β βββ JsonEditor.tsx # Monaco editor wrapper
β βββ JsonValidator.tsx # Main validator
β βββ ToolNav.tsx # Tool navigation bar
β βββ DatasetCard.tsx # Dataset preview card
β βββ ArticleLayout.tsx # Learn article layout
βββ docs/ # Documentation & content
β βββ content/ # Article markdown files
β βββ datasets/ # Dataset documentation (47 datasets)
βββ lib/ # Utility functions
β βββ jsonlint-core-integration.ts # Main validator adapter
β βββ error-codes.ts # Diagnostic reference catalog
β βββ shadow-telemetry.ts # Document-free sampled metrics
β βββ json-utils.ts # Secondary parsing/formatting operations
β βββ dataset-utils.ts # Dataset loading utilities
β βββ themes/ # Custom Shiki themes
βββ public/ # Static assets
β βββ datasets/ # JSON dataset files (47 datasets)
β βββ images/ # Logos, favicons, screenshots
βββ workers/shadow/ # Cloudflare telemetry collector and query helpers
βββ styles/
βββ globals.css # Global styles & theme variables
Pre-populate the editor using URL parameters:
?json={encoded-json}β Load JSON directly?url={url}β Fetch JSON from a URL
Example:
https://jsonlint.com/?json=%7B%22hello%22%3A%22world%22%7D
We welcome contributions! If you have suggestions, feature requests, or found a bug:
- Create a new folder in
app/with the route name - Add the converter/tool component
- Add the page to navigation in
components/ToolNav.tsxandcomponents/Footer.tsx - Add SEO content below the tool
- Create a
.mdfile indocs/content/completed/ - Include frontmatter with
titleanddescription - The page will be available at the corresponding URL and added to Learn and the sitemap automatically
- Create a JSON file in
public/datasets/ - Create a corresponding
.mdfile indocs/datasets/with frontmatter - The dataset will appear at
/datasets/{name}and in the datasets directory
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Todd Garland β Founder of BuySellAds
- @jsonlint/core β Multi-diagnostic JSON parser used by the main validator
- Monaco Editor by Microsoft
- Douglas Crockford β JSON creator
- Zach Carter β Original jsonlint implementation
jsonlint.com β Making JSON easier since 2010.