.json File Extension
.json file contains, how to open and validate JSON, how Poly supports it, and when another data format may fit better. File extension details for .json
Full Support| File type | JavaScript Object Notation data |
|---|---|
| MIME type | |
| Encoding | Unicode text, interoperably UTF-8 for exchange |
| Operating systems | Windows, macOS, Linux, iOS, Android |
| Opens with | Visual Studio Code, Notepad, TextEdit, jq |
| Poly support | Yes. Poly handles JSON as readable structured text. |
| Indexed by Poly | Yes. Poly indexes JSON keys and values for exact and semantic search. |
| Preview in Poly | Yes. JSON opens in Poly's code editor with syntax highlighting. |
| Poly agent | Yes. The Poly agent can read and reason about JSON text. |
What kind of file is a .json?
A .json file stores JavaScript Object Notation, a compact text format for exchanging structured data. It normally uses the application/json MIME type. JSON can represent objects, arrays, strings, numbers, true, false, and null. Despite its name and JavaScript-inspired syntax, it is language-independent.1
JSON has no magic number. Valid content may start with { or [, but a complete JSON document may also be a string, number, Boolean, or null after optional whitespace. The reliable check is to decode the text and parse it with a JSON parser, not merely inspect its first character.1
.json does not convert it. The content still has to follow JSON grammar.How do I open a .json on my computer?
Any text editor can display JSON on Windows, macOS, or Linux. A code editor such as Visual Studio Code is more useful for editing because it provides formatting, folding, validation, and schema-aware suggestions.2 On a terminal, jq can pretty-print, filter, and transform JSON.3
Web browsers and mobile text editors can also display many .json files. For machine use, load the file with a JSON parser provided by your programming language. Do not pass untrusted JSON to eval() or another code-execution function. JSON is data, and treating it as executable code creates an avoidable security risk.1
Poly support for .json
Poly opens JSON in a code-friendly text preview with syntax highlighting and find-in-file support. Keys and values are indexed for exact and semantic search, so you can find a configuration or exported record by its contents as well as its filename. The Poly agent can read the text and reason about the data without running scripts referenced by it.
Parsing proves only that the syntax is valid. It does not prove that required fields exist or values match an application's schema. Use a JSON Schema validator when the receiving system requires a particular structure.
History of .json
JSON was presented publicly at JSON.org in 2001. Ecma describes it as a lightweight, text-based syntax derived from ECMAScript but independent of any programming language.4 RFC 4627 registered application/json and the .json extension in 2006. The current Internet Standard, RFC 8259, was published in 2017.1
For interoperable exchange between systems, RFC 8259 requires UTF-8. It registers no magic number and no charset parameter. Senders must not add a byte order mark, although parsers may choose to ignore one.1
Working with .json and alternatives
JSON is a strong default for APIs, application data, and configuration that must work across languages. Keep these tradeoffs in mind:
| Format | Representation | Best fit |
|---|---|---|
| JSON | UTF-8 text | Portable APIs, configuration, and data exports |
| JSON Lines | One JSON value per line | Append-only logs and streaming records |
| YAML | Human-oriented text | Configuration where comments and concise notation matter |
| CBOR | Binary | Compact interchange and data types beyond JSON |
Standard JSON does not allow comments or trailing commas. Duplicate object names can also be handled inconsistently by parsers, and large numbers may lose precision in software that uses IEEE 754 binary64 values.1 For predictable protocols, I-JSON narrows JSON with stricter rules for names, numbers, and Unicode.5
Choose CBOR when binary data, compact encoding, or richer native types matter. CBOR can represent the JSON data model, but tags, byte strings, and non-string map keys need an agreed mapping when converted back to JSON.6 Changing the filename is never enough; use a parser and serializer for the destination format.
Footnotes
- Internet Engineering Task Force. RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format. ↩ ↩2 ↩3 ↩4 ↩5 ↩6
- Microsoft. Editing JSON with Visual Studio Code. ↩
- jq project. jq: Command-Line JSON Processor. ↩
- Ecma International. ECMA-404: The JSON Data Interchange Syntax. ↩
- Internet Engineering Task Force. RFC 7493: The I-JSON Message Format. ↩
- Internet Engineering Task Force. RFC 8949: Concise Binary Object Representation (CBOR). ↩