# IndieJSON

> Paste or open one JSON document, edit it as code or a tree, and leave with valid data that never leaves the browser.

Edit JSON as code or a tree. Nothing leaves your browser.

The canonical page is https://indiejson.com/.

## Use the tool

Open [IndieJSON](https://indiejson.com/) to complete the job. The questions below describe the supported input, result, and limits. Every answer names its source next to it.

Source: [RFC 8259](https://www.rfc-editor.org/rfc/rfc8259.html).

## Questions and limits

### What is valid JSON?

Valid JSON is text that follows the grammar in [RFC 8259](https://www.rfc-editor.org/rfc/rfc8259): one value, which can be an object, an array, a string, a number, `true`, `false`, or `null`. Names and strings use straight double quotes. Commas separate members, and nothing follows the last one. Comments are not part of the grammar. IndieJSON parses the whole document against that grammar, and the status bar says `Valid JSON` or names the first error with its line and column.

### Why is my JSON invalid?

The usual causes are small: a trailing comma after the last member, single quotes instead of double quotes, a name without quotes, a comment, a missing comma between two members, or text around the document such as a variable assignment or a code fence. A file copied from a JavaScript source or a chat window carries several of these at once.

The editor stops at the first error and points at its line and column, so a document with three problems shows one at a time. Fix it, and the next error takes its place. The repair proposal, described below, finds most of them in one pass and lists every change with its reason before anything is applied.

### Can JSON have duplicate keys?

The grammar allows it, and RFC 8259 section 4 says names should be unique, which means parsers are free to disagree. JavaScript keeps the last value, some libraries keep the first, and some reject the document. A payload with a duplicate name can mean one thing on your machine and another on the server. IndieJSON keeps both members as written, marks the document valid, and adds a warning that names the duplicate and where the first one is. Remove one of them before the document travels.

### Why does a large number change in JSON?

JSON puts no limit on a number, but most parsers read numbers as doubles, and a double holds integers exactly only up to 9007199254740991. A larger id or a long decimal comes out rounded, without an error. JavaScript's `JSON.parse` does this, and so do many other languages by default.

IndieJSON keeps every digit as written, marks the document valid, and shows a warning that names the number and what a double would read instead. The same warning covers a number too large or too small for a double at all. To carry such a value safely between systems, send it as a string, and parse it on the other side with a type that holds it.

### How do I fix invalid JSON?

When the document does not parse, IndieJSON proposes a repair: a list of changes, each with its position and reason, such as a removed trailing comma, a single quote replaced with a double quote, a removed comment, or `null` added for a missing value. Read the list, then apply it or fix the text by hand.

Nothing changes on its own. The repair is a proposal until you apply it, and undo takes it back. A repair fixes the shape of the text, not its meaning: a value it had to invent is `null`, and a word JSON does not have, such as `undefined` or `NaN`, becomes `null` too, so read the list before you trust the result.

### Does valid JSON mean the data is correct?

No. The verdict covers syntax and the interoperability warnings, such as duplicate names, numbers a double cannot hold, unpaired surrogate escapes, and a byte order mark. It does not know which fields your application expects, which types they must have, or whether a value makes sense. That check is JSON Schema validation, which IndieJSON does not do. Use your application's own schema or validator for it.

## Promises

- The core is free: no account, no card, no premium plan, no upgrade nag, no hidden paywall.
- Private lookup activity is never published.
- Analytics is currently off. Private lookup activity is never published or sent to a tracker. No lookup history becomes public inventory.

## More

- [Notes](https://indiejson.com/blog.md): posts by the maker, newest first
- [More tools](https://indiejson.com/tools.md): the other tools by turushan
- [security.txt](https://indiejson.com/.well-known/security.txt): how to report a vulnerability

Made by turushan, https://twitter.com/turushan.
