FormatDrop
Document Format

JSON

JavaScript Object Notation

JSON (JavaScript Object Notation) is a lightweight text-based data format that is easy for humans to read and write, and easy for machines to parse and generate. Introduced in the early 2000s by Douglas Crockford and standardized as RFC 8259, JSON has become the universal language of web APIs, configuration files, and data exchange. It represents data as key-value pairs (objects), ordered lists (arrays), strings, numbers, booleans, and null — a simple set of types that maps naturally to data structures in virtually every programming language.

What is JSON?

A JSON file stores structured data as Unicode text. Objects are wrapped in curly braces `{}`, arrays in square brackets `[]`, and keys are always quoted strings. JSON has no support for comments, no date type (dates are stored as strings), and no binary data (binary is usually Base64-encoded). Despite these limitations, JSON's simplicity is its strength — `JSON.parse()` and `JSON.stringify()` in JavaScript, and equivalent functions in Python, Ruby, Go, Java, and every other language make JSON the easiest format to work with in code.

JSON pros and cons

Advantages

  • Universal parsing support — every programming language has a JSON library
  • Human-readable and human-writable with minimal syntax
  • Native to JavaScript — `JSON.parse()` and `JSON.stringify()` are built in
  • Compact compared to XML — no opening/closing tag verbosity
  • Schema validation available via JSON Schema

Limitations

  • No comment support — cannot add explanatory notes in JSON data
  • No date/time type — dates must be stored as strings (ISO 8601 convention)
  • No binary data support — binary must be Base64-encoded
  • No trailing commas allowed — common source of parsing errors
  • Verbose for deeply nested data compared to YAML or TOML

When should you convert JSON files?

Convert JSON to CSV when you need to open data in Excel or Google Sheets (flatten nested JSON first). Convert JSON to XML when integrating with legacy enterprise systems or SOAP APIs that require XML. Convert JSON to YAML when creating config files that benefit from comments (CI/CD pipelines, Kubernetes manifests). Convert XML or CSV to JSON when building REST APIs or JavaScript applications.

All FormatDrop conversions run entirely in your browser — no file upload, no server processing. Your files stay on your device.

JSON FAQ

What is the difference between JSON and JSONC?
JSONC (JSON with Comments) is a superset of JSON that allows single-line (`//`) and multi-line (`/* */`) comments. It is not a standard JSON format — parsers that expect standard JSON will reject JSONC. VS Code uses JSONC for its settings.json and tsconfig.json files. TypeScript's tsconfig.json and ESLint's config also use JSONC. Never use JSONC for API responses or data interchange — only for config files with editors that support it.
How do I pretty-print JSON in the terminal?
Use Python: `cat file.json | python3 -m json.tool`. Use jq (a powerful JSON processor): `cat file.json | jq '.'`. Use Node.js: `node -e "console.log(JSON.stringify(require('./file.json'), null, 2))"`. In most modern code editors (VS Code), you can format JSON with Shift+Alt+F (Windows/Linux) or Shift+Option+F (macOS).
What is JSON Lines (NDJSON) and when should I use it?
JSON Lines (newline-delimited JSON, .jsonl or .ndjson) stores one JSON object per line with no surrounding array or commas between objects. This makes it ideal for streaming large datasets: you can process one line at a time without loading the entire file into memory. It is widely used for log files (Elasticsearch, Datadog), ML training data, and database bulk exports. Use NDJSON instead of a JSON array when your dataset is too large to fit in memory.