JSON Tools
Format, Validate, Compare & Transform

All-in-one JSON toolkit. Format and minify, validate with error highlighting, compare objects, explore with tree view, and convert to YAML, CSV, or TypeScript. 100% client-side - your data never leaves your browser.

JSON Tools illustration

JSON Tools

Relaxed accepts comments, trailing commas, single quotes and unquoted keys. JSONL reads one JSON value per line and reports every bad line.

Want a JSON5 reference? JSON5.dev, a separate site from the same developer. Working with JSON Lines logs? JSONL.rest, a separate site from the same developer.

Input JSON

Output

Common Use Cases

API Response Debugging

Format and validate API responses to quickly understand data structure and find issues.

Config File Comparison

Compare two versions of JSON config files to see exactly what changed between deployments.

Data Exploration

Use Tree View to explore complex nested JSON structures and find the path to any value.

TypeScript Generation

Convert JSON to TypeScript interfaces for type-safe development with automatic type inference.

Data Migration

Convert JSON to YAML for Kubernetes configs or CSV for spreadsheet analysis.

Path Discovery

Find the exact JSONPath to access deeply nested values in complex JSON structures.

JSON Reference: Syntax, Types, Errors and JSONPath

The rules JSON actually enforces (RFC 8259), the mistakes that break parsers, and how to point at any value in a document.

An example JSON object with each part labeled: the object braces, a string value, a number, a boolean, an array and a null, plus a note that every key is a double-quoted string
One small document that uses all six JSON data types.

Data types and structure

A JSON document is one value. That value is either a primitive (string, number, boolean, null) or a container that holds more values: an object (named values) or an array (ordered values). Containers nest to any depth, which is how a flat text file describes a whole tree of data.

The six JSON data types with examples
Type Example Rule
Object{"id": 7}Comma-separated "key": value pairs in braces. Keys should be unique
Array[1, "a", null]Ordered values in square brackets. Types can be mixed
String"Ada"Double quotes only. Special characters are escaped with a backslash
Number36, -1.5, 2e3Decimal only. No leading zeros, no + sign, no NaN or Infinity
Booleantrue, falseLowercase, no quotes
NullnullLowercase, no quotes. Means "no value"

See the shape of your own data with Tree View.

Common JSON syntax errors and fixes

Almost every "Unexpected token" or "Expected ',' or '}'" message comes from a short list of mistakes. The validator shows the line and column; look at that spot and the character just before it.

Common JSON syntax errors, why they fail and how to fix them
Error Why it fails Fix
Trailing commaA comma must be followed by another valueDelete the last comma before } or ]
Single quotesStrings and keys need double quotesReplace ' with "
Unquoted keyKeys are stringsWrap the key in double quotes
Missing commaTwo values with nothing between themAdd a comma between members
CommentsJSON has no comment syntaxRemove // and /* */, or store notes in a key
Unescaped newline in a stringControl characters must be escapedUse \n inside the string
Capitalized or non-JSON literalTrue, None, undefined, NaN are not JSONUse true, null, or leave the key out
Unbalanced bracketsA { or [ was never closedFormat the text and match each opener to its closer

Paste the broken text into the Validate tab to get the exact position. Error wording differs between browsers, but the position is what matters.

Four invalid JSON snippets next to their corrected versions: a trailing comma, single quotes, an unquoted key and a missing comma
Four mistakes that cause most parse failures, each with its fix.

String escapes

JSON string escape sequences
Write Meaning
\"Double quote
\\Backslash
\/Forward slash (optional escape)
\n \r \tNewline, carriage return, tab
\b \fBackspace, form feed
\u00e9Any character by its 4-digit hex code. Characters above U+FFFF use two codes, for example \ud83d\ude00

Characters below U+0020 (such as a raw newline or tab) must always be escaped. Everything else can appear as plain UTF-8.

Number rules

Valid and invalid JSON number forms
Valid Invalid Why
707No leading zeros
0.5.5Digits required before the point
55.Digits required after the point
-3+3No plus sign
1e3, 1E-20x1FNo hexadecimal
nullNaN, InfinityNot representable

JSON itself puts no limit on digits, but JavaScript reads numbers as 64-bit floats, so integers above 9,007,199,254,740,991 (253 - 1) lose precision. Send large IDs as strings.

JSON vs a JavaScript object literal

JSON looks like JavaScript, which is why code copied from a console or a config file so often fails to parse. JSON is a strict, text-only subset of the syntax.

Differences between JSON and JavaScript object literals
Feature JavaScript object JSON
KeysBare names, strings or symbolsDouble-quoted strings only
String quotesSingle, double or backtickDouble only
Trailing commasAllowedNot allowed
CommentsAllowedNot allowed
ValuesFunctions, undefined, dates, NaN, Infinity, and moreObject, array, string, number, boolean, null
DatesDate objectsNo date type. Use an ISO 8601 string such as "2026-11-26T15:04:05Z" (see the Timestamp Converter)

Need to work with YAML configs instead? Use the YAML / JSON Converter, or compare two payloads with the Diff Checker.

JSONPath basics

JSONPath (standardized as RFC 9535) is a short way to name one value inside a document: start at the root $, then step down by key or index. In the Tree View, click any value and the tool fills in its path using exactly these building blocks, ready to copy.

Example document

{
  "store": {
    "name": "Corner Books",
    "books": [
      { "title": "Dune", "price": 9 },
      { "title": "Emma", "price": 7 }
    ]
  }
}
Example JSONPath expressions and the values they select
Path Selects
$The whole document
$.store.name"Corner Books"
$.store.books[0]The first book object
$.store.books[1].title"Emma"
JSONPath syntax elements
Syntax Meaning In this tool
$Root of the documentGenerated
.nameChild by keyGenerated
[0]Array element by index (starts at 0)Generated
['name']Child by key in bracket form, for keys with spaces or dotsStandard JSONPath, not generated
[*]Every childStandard JSONPath, not generated
..nameDescendant search at any depthStandard JSONPath, not generated
[0:2]Array slice (start up to, not including, end)Standard JSONPath, not generated
[[email protected] < 8]Filter: children where the test is trueStandard JSONPath, not generated

The tool shows you the path to a value you click; it does not run JSONPath queries against your data.

Which tab should I use?

The six JSON Tools tabs and when to use each
You want to... Use Tip
Read a one-line API responseFormatBeautify with 2 spaces; minify again before sending it back
Find out why a parser rejects your textValidateCheck the line and column, then the character just before it
See what changed between two payloadsCompareTurn on "Ignore key order" when key order is not meaningful
Explore a deeply nested documentTree ViewClick a value to copy its JSONPath
Generate a JSON Schema, or check data against oneSchemaGenerate from a sample, then validate the real payloads against it
Turn JSON into another formatConvertYAML, CSV (for arrays), TypeScript interface, Zod schema, XML, JSONL, or typed models for Go, Rust, C#, Python, Java, Swift and Kotlin

JWT payloads are JSON too: decode one with the JWT Decoder or the Base64 Encoder, then paste the payload here.

JSON cheat sheet

A printable reference: syntax, the six types, string escapes, number rules, common errors and JSONPath basics.

Download the JSON Tools cheat sheet (PDF)

Frequently Asked Questions

Why We Built JSON Tools

Developers work with JSON constantly - it's the universal data format for APIs, configuration files, and data exchange. But working with JSON often requires juggling multiple different websites: one for formatting, another for validation, a third for comparing changes, and yet another for conversions. Each context switch breaks your flow and wastes time.

JSON Tools consolidates five essential JSON utilities into one cohesive interface. Format and minify with customizable indentation. Validate with detailed error messages that pinpoint exactly where the problem is. Compare two JSON objects with semantic diffing that understands structure, not just text. Explore nested data with an interactive tree view that shows you the JSONPath to any value. Convert to YAML, CSV, TypeScript, or XML with a single click.

Like all tools on RJL.io, JSON Tools runs 100% in your browser. Your data never touches our servers. There's no tracking, no accounts, no limits. Just paste your JSON and get to work. Whether you're debugging an API response at 2am or comparing config files before a deployment, JSON Tools has everything you need in one place.

Need more developer tools? Check out our Pretty Print for multi-format code formatting, Base64 Encoder/Decoder for encoding data, or UUID Generator for creating unique identifiers. For working with APIs, try our QR Code Generator or scan codes with our QR Scanner.

Is your site ready for Google and AI search?

The free SEO Analyzer checks any page in seconds - meta tags, structured data, AI crawler access - and tells you exactly how to fix each issue on your platform.