Ffile2fix
Sign in Get started

What is a .json file?

A .json file stores structured data as JavaScript Object Notation: objects, arrays, strings, numbers, booleans and null. It is used for API responses, package.json and composer.json manifests, app settings and data exports.

Key facts

  • Defined by RFC 8259 and ECMA-404; must be encoded as UTF-8 when exchanged between systems.
  • MIME type is application/json.
  • Keys and strings need double quotes; comments, trailing commas, single quotes, NaN and undefined are not allowed.
  • JSON Lines (.jsonl) puts one JSON value per line and is common for logs and large exports.
  • Variants such as JSONC (VS Code settings) and JSON5 allow comments but are not valid strict JSON.

How to open a .json file

Windows

Open it in VS Code or Notepad++, or drag it into Firefox or Edge, which show a collapsible viewer. In PowerShell, Get-Content file.json | ConvertFrom-Json parses it.

macOS

Open it in any code editor or a browser, or run python3 -m json.tool file.json in Terminal to validate and pretty-print it.

Linux

Run jq . file.json to pretty-print and validate, or python3 -m json.tool file.json if jq is not installed.

Common problems and fixes

"Unexpected token" or "Expecting property name enclosed in double quotes"
The file uses single quotes, unquoted keys or comments, which strict JSON forbids. Replace single quotes with double quotes and remove comments.
Trailing comma error near } or ]
A comma after the last item in an object or array is invalid JSON. Delete that comma; the parser's line and column number point to it.
"Unexpected end of JSON input"
The file or API response was cut off, or is empty. Check for missing closing brackets and confirm the full response arrived.
"Unexpected token < in JSON at position 0"
The server returned an HTML page (often an error page or login redirect) instead of JSON. Open the URL directly to see the real response and fix the endpoint or authentication.
Invisible characters or a BOM break parsing
Some editors save a UTF-8 byte-order mark or copy smart quotes. Re-save as UTF-8 without BOM and replace curly quotes with straight ones.

Often converted to or from: CSV, XML, YAML, PHP array, JSON Lines

Frequently asked questions

Can JSON files have comments?

Not in standard JSON; parsers will reject them. Some tools accept JSONC or JSON5 with comments, but strip them before sending data to an API or strict parser.

How do I open a JSON file in Excel?

Use Data > Get Data > From File > From JSON, which opens Power Query to expand nested fields. For deeply nested data, flattening it to CSV first is often easier.

What is the difference between JSON and YAML?

Both describe the same kinds of data; YAML uses indentation and allows comments, while JSON uses brackets and is stricter. Valid JSON is also valid YAML 1.2.

See all file types β†’ Β· Browse error fixes β†’