# JSON as the Standard — REST API Design

Source: https://www.geekswithgeeks.com/en/restapi/api-json-format

> Why JSON won as the default wire format for REST APIs.

## Text, typed, and everywhere

JSON is human-readable, maps cleanly onto objects/arrays/strings/numbers/booleans, and has a parser in every language. Unlike XML it carries little ceremony — no closing tags, no attributes-vs-elements debate.

## Always set Content-Type

Return `Content-Type: application/json; charset=utf-8` on every JSON response, even error bodies — clients shouldn't have to guess.

## Numbers and dates need care

JSON has no native date type (use ISO 8601 strings like `2026-09-04T10:00:00Z`) and its numbers can lose precision beyond ~2^53 — send very large IDs as strings.
