What is a JSON file?
JSON is how apps and websites pass data around. Every programming language reads it the same way, which is why it has become the default for APIs, exports and settings files. You can convert JSON files here, both into the format and out of it.
Specification
| Full name | JavaScript Object Notation |
|---|---|
| Extensions | .json |
| Media type | application/json |
| Compression | Uncompressed |
| Transparency | — |
| Animation | — |
| Multiple pages | — |
| Colour depth | UTF-8 text, six value types, no comments or trailing commas |
| Size limits | — |
| Introduced | 2001 |
| Developed by | Douglas Crockford |
| Standard | Open |
| Browser support | Every browser, including older ones |
What JSON is used for
- HTTP API request and response bodies
- Application configuration files such as package.json and tsconfig.json
- Exporting records from a database or admin tool
- Storing structured state in browsers and mobile apps
Strengths and limitations
What JSON does well
- Parsed natively by browsers and by every server language without a library
- Human readable, so a malformed payload can be debugged by eye
- Nests arbitrarily, so hierarchical data needs no flattening
Where JSON falls short
- No comments, so configuration files cannot be annotated
- Very large numbers can quietly lose precision
- Verbose compared to binary formats, with keys repeated on every record
Convert JSON to
Every target this format can be written out as, each on its own page.
Convert to JSON
Everything that can be turned into a JSON file.
Tools that accept JSON
Questions about JSON
What is a .json file?
JSON is how apps and websites pass data around. The extension .json identifies it, and its media type is application/json.
How do I open a JSON file?
Any current browser will open it directly, so dragging the file into a tab is usually enough. Most operating systems also preview it without extra software.
Is JSON lossy or lossless?
Uncompressed. Nothing is discarded, so repeated saves never degrade the contents.
What is JSON good for?
Parsed natively by browsers and by every server language without a library. Human readable, so a malformed payload can be debugged by eye. Nests arbitrarily, so hierarchical data needs no flattening. In practice that makes it a good fit for HTTP API request and response bodies, and Application configuration files such as package.json and tsconfig.json.
What are the drawbacks of JSON?
No comments, so configuration files cannot be annotated. Very large numbers can quietly lose precision. Verbose compared to binary formats, with keys repeated on every record.