What Is a JSON File? Definition, Extension & How to Open
A developer's guide to JSON files: the RFC 8259 definition, the .json extension, how to open and pretty-print one, and what a JSON Schema file is.
Have broken JSON right now? Fix it free in under 1 second — no signup.
Fix My JSON →A JSON file is a plain text file, usually with a .json extension, that stores data using the JSON format defined in RFC 8259: objects, arrays, strings, numbers, booleans, and null. It's human-readable, language-independent, and the default format for APIs, config files, and AI tool output.
Written by The JSON Medic.
What Is a JSON File? Definition
RFC 8259 defines JSON (JavaScript Object Notation) as a text format for representing structured data. A JSON file is any file that contains data written in this format: a top-level object or array, built from six value types — object, array, string, number, boolean, and null. There's no schema requirement baked into the format itself, no comments allowed, and no trailing commas.
Here's a minimal JSON file:
{
"name": "Ada",
"active": true,
"tags": ["admin", "beta"]
}
That's the whole idea: curly braces for objects, square brackets for arrays, double-quoted keys and strings, and nothing else needed to parse it correctly.
JSON File Extension and MIME Type
RFC 8259 specifies .json as the file extension for JSON documents and application/json as the MIME type used when JSON is sent over HTTP. When an API responds with JSON, its Content-Type header should read application/json, regardless of what the file on disk is named.
In practice, the extension is a convention operating systems and editors use to pick a syntax highlighter or associated program — nothing in the file's contents enforces it. A file named data.txt containing valid JSON is still valid JSON; it just won't get JSON-aware tooling by default.
Is a JSON File Just a Text File?
Yes. RFC 8259 states JSON text is a sequence of Unicode characters. There's no binary header, no compression, no metadata block — just characters, the same as a .txt or .csv file. That's why you can open a .json file in Notepad, cat it in a terminal, or paste it into a chat window and it looks exactly like what it is.
This is also why JSON is easy to break. A stray comma, an unescaped quote, or a missing bracket from copy-pasting AI output can invalidate the whole file, because a text editor won't stop you from typing something structurally wrong.
How Do I Open a .JSON File?
Since a .json file is plain text, any text editor opens it: VS Code, Sublime, Notepad++, TextEdit, or even a basic terminal command like cat or less. Most code editors auto-detect the .json extension and apply syntax highlighting, which makes brackets and strings easier to scan.
The catch: most real-world JSON files are minified — one long line with no spacing. A plain text editor will show that line correctly, but it's hard to read. For that, open the file's contents in a browser-based formatter that adds indentation and line breaks without changing the data.
How to Convert a JSON File to Readable Format
Pretty-printing is the process of adding indentation and line breaks to JSON so nested objects and arrays are visually clear. Paste your JSON into our formatter at /format, and it pretty-prints instantly with configurable indentation — no signup, no upload, runs in your browser.
Before:
{"user":{"id":1,"name":"Ada"},"active":true}
After pretty-printing:
{
"user": {
"id": 1,
"name": "Ada"
},
"active": true
}
Same data, same bytes when parsed — just laid out for a human to read.
Can You Convert a JSON File to PDF?
Not on this site — there's no PDF converter among our tools right now. If you need a JSON file as a PDF, the practical workaround is to pretty-print it at /format first, then use your browser's built-in Print → Save as PDF option on the formatted page. It's not automated, but it works for sharing a readable snapshot.
What Is a JSON Schema File?
A JSON schema file is a JSON document that describes what another JSON document should look like — which fields are required, what type each value must be, and what shape nested objects take. It's used for validation and for generating documentation or types automatically.
You don't have to write a schema by hand. Paste a sample JSON document into our schema generator at /json-schema-generator and it produces a draft 2020-12 schema with inferred types and required fields — it also auto-repairs broken JSON before generating the schema.
What Is a JSON Schema File Extension?
There's no dedicated extension defined by RFC 8259 for schema files — a schema is itself JSON, so .json works fine. Some teams use .schema.json instead, to signal at a glance that the file is a schema and not a regular data file. Both are conventions, not requirements; tooling that reads schemas generally doesn't care which one you pick, as long as the content is valid JSON.
Key takeaways
- A JSON file is plain Unicode text — no special binary encoding, no hidden structure.
- RFC 8259 defines the .json extension and the application/json MIME type.
- Any text editor opens a .json file; a formatter makes it readable.
- There's no PDF converter on this site — pretty-print then use your browser's Print to PDF.
- A JSON schema file is a JSON document that describes the shape of another JSON document.
FAQ
How do I open a .JSON file?
Open it with any text editor (VS Code, Notepad, TextEdit) since it's plain text. For a readable, indented view, paste it into a browser-based formatter instead of squinting at one long line.
Can I convert a JSON file to PDF?
Not directly on this site — there's no PDF converter listed among our tools. Pretty-print the JSON first, then use your browser's Print to PDF option on the formatted output.
Is a JSON file just a text file?
Yes. RFC 8259 defines JSON as text encoded in Unicode. Any file ending in .json is a plain text file that happens to follow JSON's syntax rules.
How do I convert a JSON file to readable?
Paste it into a JSON formatter and pretty-print it with indentation. That turns a single unbroken line into properly nested, readable lines.
What is a JSON schema file?
A JSON document that describes the structure, types, and required fields another JSON document should have. It's still JSON, just describing JSON.
What is a JSON schema file extension?
Usually .json, sometimes .schema.json by convention. Neither is an official RFC 8259 requirement — it's a naming habit, not a spec rule.
Still dealing with broken JSON?
Paste it in and get it fixed in under 1 second — free, no signup, no install. Works with ChatGPT, Claude, n8n, and any AI output.
Fix My JSON Free →Related Articles