What Is JSON?
JSON, short for JavaScript Object Notation, is a plain-text format for storing and exchanging data. It is used by web APIs, apps, databases and settings files because it is light and readable by both people and programs. A JSON document is built from objects (key and value pairs in curly braces), arrays (lists in square brackets), strings, numbers, and the values true, false and null.
Data is often sent as one long line to save space. A JSON formatter, also called a beautifier or pretty printer, adds line breaks and indentation so the structure is easy to read. A validator checks that the text follows the JSON rules and tells you where it does not.
What This JSON Formatter and Validator Does
- Formats and minifies: choose 2, 3 or 4 spaces, one tab, or compact output.
- Validates: checks your text against RFC 8259, RFC 7159, ECMA-404 or RFC 4627 and reports the line and column of the first error.
- Fixes common mistakes: an optional repair mode, described below.
- Shows a tree view: expand and collapse objects and arrays, with values coloured by type.
- Sorts keys: puts object keys in A to Z order, which makes files easier to compare.
- Keeps numbers exact: digits are shown as written, so very large numbers are not rounded.
- Warns about duplicate keys, which many parsers silently overwrite.
- Loads files and web addresses, and lets you copy or download the result.
How to Use the JSON Formatter
- Paste your JSON into the left box, drop a file onto it, or use Open a file. You can also load a public JSON address.
- Read the status bar. A green message means the JSON is valid. A red one explains the problem and where it is.
- Pick an output template and, if you like, sort the keys.
- Switch to Tree to explore the structure, or stay on Text to copy the result.
- Press Copy result or Download .json.
Which JSON Standard Should You Choose?
When in doubt, use RFC 8259. It is the current standard and gives the best compatibility. RFC 7159 and ECMA-404 describe the same syntax, so most documents pass all three. The original RFC 4627 is stricter: the top-level value must be an object or an array, so a document that is just a string or a number fails that check.
Fix Common JSON Errors
With Fix common errors switched on, the tool repairs the most frequent mistakes before it validates:
- Single quotes and curly quotes become straight double quotes.
- Keys without quotes, including numeric keys, are put in double quotes.
- True, False and Null are changed to lowercase.
- Line breaks and tabs inside strings are escaped.
- Comments and trailing commas are removed, and a byte order mark at the start is dropped.
The status bar lists what was changed. The repair makes sensible guesses, so always check that the result still means what you intended. If the JSON is invalid and the tool thinks a repair would work, it tells you to turn the option on.
Common JSON Errors and What They Mean
- Trailing comma: a comma after the last item in an object or array is not allowed.
- Single quotes: JSON requires double quotes around strings and keys.
- Unquoted keys: JavaScript allows them, but JSON does not.
- Comments: JSON has no comment syntax.
- NaN, Infinity and undefined: these are JavaScript values, not JSON. Use null or a string.
- Leading zeros and plus signs: numbers such as 01 or +5 are invalid.
- Unescaped line breaks in a string: write them as \n.
- Extra data: a document can hold only one top-level value.
- Duplicate keys: allowed by the parser, but a warning because only one value usually survives.
Working With Encoded Data
JSON in the real world is often wrapped in something else. API tokens, webhook payloads and config values frequently carry JSON as Base64 text. Decode it with the Base64 Encoder/Decoder, then paste the result here to read it.
JSON is also how many crypto exchanges, wallets and tracking tools deliver trade data through their APIs. You can format and inspect an export here, but never paste API keys, secrets or private keys into any online tool. When you want to estimate the profit, tax and TDS on a trade, the Lumara Crypto Tax Calculator works from a buy price, a sell price and a quantity. It gives estimates only, not tax advice.
Limits and Good to Know
- Files up to 20 MB can be opened. Very large documents take longer to process, depending on your device.
- Nesting is limited to 512 levels. The tree view works for documents with up to 3,000 values, and larger ones use the text view.
- Only the first error is shown at a time. Fix it and the next one, if any, appears.
- Loading from a web address is done by your browser, so the site must allow requests from other websites. Many APIs do, and some do not.
How the Validator Works
The tool reads your text character by character with its own parser instead of relying only on the browser. That is why it can report the exact line and column of the first problem and explain it in plain words. Strings and numbers are kept exactly as you wrote them, so very large numbers are never rounded. It also warns about duplicate keys and stops at a nesting depth of 512. With Fix common errors on, a repair pass runs first, and the result is then checked as strict JSON.
Example: Repairing a Broken Document
This text has several mistakes: keys without quotes, single quotes, a trailing comma and a capitalized True.
{name: 'Lumara', tools: [1, 2, 3,], free: True}
With the fix option off, the tool reports: line 1, column 2: Object keys must be in double quotes. With Fix common errors on, it repairs the text (3 unquoted keys, 1 quotes, 1 trailing commas, 1 literals) and outputs:
{
"name": "Lumara",
"tools": [
1,
2,
3
],
"free": true
}
Where People Use a JSON Validator
- Reading and debugging responses from an API.
- Checking configuration and settings files before deploying them.
- Inspecting webhook payloads sent by other services.
- Cleaning up data exports and log entries.
Frequently Asked Questions
Is my JSON uploaded or saved?
The formatting and validation run in your browser. The tool does not send your JSON to our servers or save it. If you use the web address option, your browser contacts that address directly. The page also loads a cookie banner and an advertisement from third-party services, described in our Privacy Policy. Avoid pasting secrets.
What is the difference between formatting and validating?
Formatting changes how the JSON is laid out. Validating checks that it follows the rules. This tool does both together, so a successful format also means the JSON is valid.
How do I minify JSON?
Choose Compact (minified) as the output template. All extra spaces and line breaks are removed.
Does the tool change my key order or numbers?
No. Keys stay in their original order unless you switch on sorting, and numbers and strings are kept exactly as written.
Can it fix a trailing comma or single quotes?
Yes. Turn on Fix common errors.
Why do I get "Invalid JSON"?
The text breaks a JSON rule. The message names the problem and its line and column. Use the Jump to the error button to select that spot in your text.
Does it support Unicode and emoji?
Yes. Accented letters, Arabic, other scripts and emoji are kept as they are.
Related Tools and Guide
- Base64 Encoder/Decoder Encode text or files to Base64 and decode Base64 back to text or files. Supports Unicode, other character sets and URL-safe Base64.
- URL Encoder/Decoder Encode or decode URLs and query strings with several encoding types and character sets, and break any link into its parts.
- Text Case Converter Change text to sentence, lower, UPPER, Title or Capitalized case, plus camelCase, snake_case and kebab-case. Keeps names and acronyms.
- Read the guide: JSON Formatter & Validator: Format, Minify and Fix JSON A step-by-step article about this tool.