THE FILE FIELD GUIDE
.json

JSON Data

Web & Development

JSON represents objects and arrays as data. Standard JSON uses double-quoted keys/strings and excludes comments and trailing commas. JSONC-like syntax is not necessarily accepted.

What it is used for
Application settings, APIs and data exchange
What the file contains
Text
All sections, questions and sources

Content reviewed: · Editor:Kai

Opening steps

Choose your environment or purpose to see its steps.

Editor: inspect the structure

Make a copy before saving.

  1. Open in an editor such as VS Code and select the appropriate language mode.
  2. Distinguish keys, arrays, strings and numbers and inspect brackets and commas.
  3. Inspect encoding and line endings and avoid saving as rich text.
Syntax: validate as JSON

Distinguish JSON from commented JSON.

  1. Parse the copy through editor diagnostics or a JSON parser.
  2. Inspect double quotes, trailing commas and comments around the error.
  3. Revalidate and compare values after formatting.
Application: import as data

Valid syntax does not guarantee valid application data.

  1. Inspect the application’s schema and required keys.
  2. Import in a test environment and inspect type/required-field errors.
  3. Verify counts, identifiers, dates and nulls before using the data.

Menu labels and support vary by app, OS and version. Preserve the original before making changes.

Troubleshooting by symptom

  • Syntax failure: check trailing commas, single quotes, comments and escaped newlines.
  • Valid syntax but rejected: inspect required keys/types and the application’s schema.
  • Encoding failure: check UTF-8 for interchange and identify the source encoding before resaving.
  • Trailing-comma error: strict JSON disallows trailing commas/comments; distinguish JSONC settings.
  • Identifier digits change: check integer precision and use strings when required by the schema.
  • Valid JSON is rejected: compare required keys, types and permitted values with the schema.

JSON → CSV / formatted JSON

  1. Choose the array/columns and decide how nested values should be represented.
  2. Export separately and compare row count, leading zeros, dates and missing values.
  3. Compare keys, record counts and types before/after conversion and document unsupported items.

CSV may lose nesting and type information. Keep the original JSON.

Minimal JSON and value types

Keys and strings use double quotes. A numeric string differs from a number, and null differs from an empty string.

Formatting improves readability; it does not establish schema or value correctness.

{"name":"example","count":2,"enabled":true,"items":["a","b"]}

Source for these steps:Microsoft · Editing JSON with Visual Studio Code / Python Software Foundation · json — JSON encoder and decoder

Checking hierarchy lost during CSV export

Nested objects/arrays differ from a flat table. Decide whether array expansion creates more rows or separate tables.

Retain JSON and inspect the meaning of identifiers, nulls and multiline strings in the output.

Source for these steps:Microsoft · Editing JSON with Visual Studio Code / Python Software Foundation · json — JSON encoder and decoder

Related-format differences

Related-format differences
FormatMain roleSelection notes
JSONHierarchical dataValidate keys and types
CSVFlat tableRequires flattening rules
JSONCComment-capable settingsDifferent from strict JSON

Handling and security

Settings may contain tokens/API keys. Check secrets before using online formatters and review the consuming application’s behavior.

Questions and answers

Does JSON allow comments?

Standard JSON does not; JSONC support is application-specific.

Is a quoted number still a number?

No; it becomes a string.

Does formatting repair bad data?

No; inspect syntax and application requirements.

Does JSON automatically become a spreadsheet?

Decide how to flatten objects/arrays into rows and columns and verify the imported counts.

May I repeat an object key?

Avoid it because implementations may handle duplicates differently. Detect and resolve them intentionally.

Format facts: name, steward and MIME type
Formal name
JavaScript Object Notation
Steward / specification
IETF (RFC 8259)
MIME type
application/json

Primary and official sources

  • StandardRFC 8259 — JSON

    Defines JSON syntax and interoperability considerations.

    IETF / RFC Editor · Link checked:
  • Software documentationEditing JSON with Visual Studio Code

    Documents JSON validation, formatting and JSONC support.

    Microsoft · Link checked:
  • Project documentationjson — JSON encoder and decoder

    JSON types, parsing and numeric/duplicate-key considerations.

    Python Software Foundation · Link checked: